fixed broken animation of CE that can not change, but has CE delay action
authorHolger Schemel <info@artsoft.org>
Sat, 10 Jun 2023 09:51:21 +0000 (11:51 +0200)
committerHolger Schemel <info@artsoft.org>
Sat, 10 Jun 2023 10:03:38 +0000 (12:03 +0200)
This fixes a bug that occurred if a custom element with an animation
has a CE action defined to be triggered after a delay, but without a
CE change, in which cause there was no animation displayed at all.

src/game.c

index 56f36518d9576cec0d8752c57ce8944bf373196d..9b890f49d94f0cbf49d1a2f146dc5b116e70abf8 100644 (file)
@@ -10934,13 +10934,14 @@ static void HandleElementChange(int x, int y, int page)
 
   if (ChangeDelay[x][y] != 0)          // continue element change
   {
-    if (change->can_change)
-    {
-      int graphic = el_act_dir2img(element, GfxAction[x][y], GfxDir[x][y]);
+    int graphic = el_act_dir2img(element, GfxAction[x][y], GfxDir[x][y]);
 
-      if (IS_ANIMATED(graphic))
-       DrawLevelGraphicAnimationIfNeeded(x, y, graphic);
+    // also needed if CE can not change, but has CE delay with CE action
+    if (IS_ANIMATED(graphic))
+      DrawLevelGraphicAnimationIfNeeded(x, y, graphic);
 
+    if (change->can_change)
+    {
       if (change->change_function)
        change->change_function(x, y);
     }