fixed graphical bug when pushing rocks onto BD style conveyor belts
authorHolger Schemel <holger.schemel@virtion.de>
Tue, 5 Nov 2024 18:31:43 +0000 (19:31 +0100)
committerHolger Schemel <holger.schemel@virtion.de>
Tue, 5 Nov 2024 16:34:05 +0000 (17:34 +0100)
When pushing a rock onto a right-moving conveyor belt from the left
side using the BD engine and using the "buggy conveyor belts" editor
setting (used by native BD caves by default), the player pushing that
rock was displayed with a broken animation when using "smooth movement
animations" for the BD engine.

This change fixes this graphical bug.

(The first part fixes placing a space, which is not a movement,
while the second part seems not to be required otherwise anyway.)

src/game_bd/bd_caveengine.c
src/game_bd/bd_graphics.c

index b4c9219efb27a15610e1af579bd0872a52a70e6f..c6b8a30b7403c4345b3354755df0f2ebebb3825e 100644 (file)
@@ -3684,7 +3684,7 @@ void gd_cave_iterate(GdCave *cave, GdDirection player_move, boolean player_fire,
                 if (game_bd.game->dir_buffer_to[old_y][old_x] != move_dir ||
                     cave->conveyor_belts_buggy)
                 {
-                  store_dir(cave, x, y, GD_MV_UP, O_SPACE);        // place a space ...
+                  store(cave, old_x, old_y, O_SPACE);              // place a space ...
                   store_dir(cave, old_x, old_y, move_dir, tile);   // and move element.
                 }
              }
@@ -3719,7 +3719,7 @@ void gd_cave_iterate(GdCave *cave, GdDirection player_move, boolean player_fire,
                 if (game_bd.game->dir_buffer_to[old_y][old_x] != move_dir ||
                     cave->conveyor_belts_buggy)
                 {
-                  store_dir(cave, x, y, GD_MV_DOWN, O_SPACE);      // place a space ...
+                  store(cave, old_x, old_y, O_SPACE);              // place a space ...
                   store_dir(cave, old_x, old_y, move_dir, tile);   // and move element.
                 }
              }
index 74d6b6e9f32c2677d4ebf694fe8105b5807a47a8..69c0344e2bd07fc54b044ac1542f503847327b40 100644 (file)
@@ -658,10 +658,6 @@ static void gd_drawcave_tile(Bitmap *dest, GdGame *game, int x, int y, boolean d
   if (cave->player_state == GD_PL_EXITED)
     use_smooth_movements = FALSE;
 
-  // never treat empty space as "moving" (source tile if player is snapping)
-  if (tile_from == O_SPACE)
-    use_smooth_movements = FALSE;
-
   // do not use smooth movement animation for player stirring the pot
   if (tile_from == O_PLAYER_STIRRING || tile_to == O_PLAYER_STIRRING)
     use_smooth_movements = FALSE;