From: Holger Schemel Date: Sun, 6 Oct 2024 18:00:06 +0000 (+0200) Subject: fixed smooth movement for elements in magic wall with no space below X-Git-Tag: 4.4.0.0-test-4~151 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=b3b5fe67fa218b2fad10bf7271ce03aec3f4c328;p=rocksndiamonds.git fixed smooth movement for elements in magic wall with no space below --- diff --git a/src/game_bd/bd_caveengine.c b/src/game_bd/bd_caveengine.c index df6553dc..cee8d4e7 100644 --- a/src/game_bd/bd_caveengine.c +++ b/src/game_bd/bd_caveengine.c @@ -1624,12 +1624,19 @@ static boolean do_fall_try_magic(GdCave *cave, int x, int y, GdDirection fall_di if (cave->magic_wall_state == GD_MW_DORMANT) cave->magic_wall_state = GD_MW_ACTIVE; - if (cave->magic_wall_state == GD_MW_ACTIVE && - is_like_space(cave, x, y, twice[fall_dir])) + if (cave->magic_wall_state == GD_MW_ACTIVE) { - // if magic wall active and place underneath, it turns element - // into anything the effect says to do. - store_dir(cave, x, y, twice[fall_dir], magic); + if (is_like_space(cave, x, y, twice[fall_dir])) + { + // if magic wall active and place underneath, it turns element + // into anything the effect says to do. + store_dir(cave, x, y, twice[fall_dir], magic); + } + else + { + // store from/to directions in special buffers for smooth movement animations + store_dir_buffer(cave, x, y, fall_dir); + } } // active or non-active or anything, element falling in will always disappear diff --git a/src/game_bd/bd_graphics.c b/src/game_bd/bd_graphics.c index 107acc6b..74d6b6e9 100644 --- a/src/game_bd/bd_graphics.c +++ b/src/game_bd/bd_graphics.c @@ -605,9 +605,10 @@ static void gd_drawcave_tile(Bitmap *dest, GdGame *game, int x, int y, boolean d tile_from = game->element_buffer[new_y][new_x]; draw_from = game->drawing_buffer[new_y][new_x]; - if (is_double_movement) + if (is_double_movement || tile_from == O_MAGIC_WALL) { - // for magic wall or slime, use source tile instead of target tile + // for magic wall or slime, use source tile instead of (changed) target tile + // also required for element falling into magic wall with no space below it tile_from = tile_last; draw_from = draw_last; }