From ea775c254b0a6270540af38a6288094e3a0b1944 Mon Sep 17 00:00:00 2001 From: Holger Schemel Date: Sat, 10 Jun 2023 11:51:21 +0200 Subject: [PATCH] fixed broken animation of CE that can not change, but has CE delay action 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 | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/game.c b/src/game.c index 56f36518..9b890f49 100644 --- a/src/game.c +++ b/src/game.c @@ -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); } -- 2.34.1