From: Holger Schemel Date: Sat, 10 Jun 2023 09:51:21 +0000 (+0200) Subject: fixed broken animation of CE that can not change, but has CE delay action X-Git-Tag: 4.3.7.0~48 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=ea775c254b0a6270540af38a6288094e3a0b1944;p=rocksndiamonds.git 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. --- 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); }