fixed isAnimated for images that have not been cached
This commit is contained in:
parent
50ae5d01f0
commit
af2cd5466b
2 changed files with 3 additions and 2 deletions
|
|
@ -141,6 +141,9 @@ export class Item extends Entity {
|
|||
}
|
||||
|
||||
public isAnimated(): boolean {
|
||||
if (!stendhal.data.sprites.get(this.sprite.filename).height) {
|
||||
return false;
|
||||
}
|
||||
if (this.animated == null) {
|
||||
// store animation state
|
||||
this.animated = (stendhal.data.sprites.get(this.sprite.filename).width / 32) > 1;
|
||||
|
|
|
|||
|
|
@ -103,8 +103,6 @@ export class ItemContainerImplementation {
|
|||
if (item["name"] === "emerald ring" && item["amount"] == 0) {
|
||||
yOffset = -32;
|
||||
} else if (item.isAnimated()) {
|
||||
// FIXME: animation does not start until item is removed &
|
||||
// picked up from ground or zone change
|
||||
item.stepAnimation();
|
||||
xOffset = -(item.getXFrameIndex() * 32);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue