fixed isAnimated for images that have not been cached

This commit is contained in:
Hendrik Brummermann 2022-04-02 11:30:45 +02:00
parent 50ae5d01f0
commit af2cd5466b
2 changed files with 3 additions and 2 deletions

View file

@ -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;

View file

@ -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);
}