fixed graphical bug with snapping player drawn as moving into explosion
authorHolger Schemel <holger.schemel@virtion.de>
Mon, 23 Sep 2024 17:37:08 +0000 (19:37 +0200)
committerHolger Schemel <holger.schemel@virtion.de>
Mon, 23 Sep 2024 17:43:12 +0000 (19:43 +0200)
This fixes a graphical bug with smooth movement animation in the BD
engine: When the player is snapping a tile that immediately after is
replaced by an explosion next to the player, the player was drawn as
moving into that explosion (without actually moving at all, as he was
only snapping). This change fixes this bug by checking if the player
actually moved.

src/game_bd/bd_graphics.c

index 5814fcc91fdfa8eb08867aa5c69717c752d5fe7a..f6548a12981a30a7ca3043a2f9e325fb83dce583 100644 (file)
@@ -688,7 +688,7 @@ static void gd_drawcave_tile(Bitmap *dest, GdGame *game, int x, int y, boolean d
     draw_from = game->drawing_buffer[new_y][new_x];
 
     // handle special case of player running into enemy/explosion from top or left side
-    if (el_player(tile_last) && el_destroying(tile_from))
+    if (el_player(tile_last) && !el_player(tile) && el_destroying(tile_from))
       tile_from = tile_last;
 
     // handle special case of player digging or snapping clock (which gets replaced by sand)