From 737076a12648a9b5af1c75ea1ac3622b0c151dcb Mon Sep 17 00:00:00 2001 From: Alexander Batalov Date: Thu, 22 Dec 2022 14:20:37 +0300 Subject: [PATCH] Fix getting elevation of freed object --- src/animation.cc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/animation.cc b/src/animation.cc index b42ffe1..cfd91b8 100644 --- a/src/animation.cc +++ b/src/animation.cc @@ -1578,7 +1578,6 @@ static int _anim_set_end(int animationSequenceIndex) AnimationSequence* animationSequence; AnimationDescription* animationDescription; int i; - Rect v27; if (animationSequenceIndex == -1) { return -1; @@ -1599,8 +1598,10 @@ static int _anim_set_end(int animationSequenceIndex) for (i = 0; i < animationSequence->length; i++) { animationDescription = &(animationSequence->animations[i]); if (animationDescription->kind == ANIM_KIND_HIDE && ((i < animationSequence->animationIndex) || (animationDescription->extendedFlags & ANIMATION_SEQUENCE_FORCED))) { - objectDestroy(animationDescription->owner, &v27); - tileWindowRefreshRect(&v27, animationDescription->owner->elevation); + Rect rect; + int elevation = animationDescription->owner->elevation; + objectDestroy(animationDescription->owner, &rect); + tileWindowRefreshRect(&rect, elevation); } }