From: Holger Schemel Date: Sun, 15 Sep 2024 22:33:32 +0000 (+0200) Subject: changed BD engine to match new GDash code (expanding walls) X-Git-Tag: 4.4.0.0-test-4~232 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=6c259038039d4a51120c10d2bdd2e0151c848e4c;p=rocksndiamonds.git changed BD engine to match new GDash code (expanding walls) --- diff --git a/src/game_bd/bd_caveengine.c b/src/game_bd/bd_caveengine.c index 53acb862..f2753a1c 100644 --- a/src/game_bd/bd_caveengine.c +++ b/src/game_bd/bd_caveengine.c @@ -3420,25 +3420,40 @@ void gd_cave_iterate(GdCave *cave, GdDirection player_move, boolean player_fire, get(cave, x, y) == O_V_EXPANDING_STEEL_WALL) && cave->expanding_wall_changed)) { - if (is_like_space(cave, x, y, GD_MV_LEFT)) + // special case: check both directions when using old engine + boolean check_both_directions = TRUE; + + if (check_both_directions && is_like_space(cave, x, y, GD_MV_LEFT)) { store_dir(cave, x, y, GD_MV_LEFT, get(cave, x, y)); play_sound_of_element(cave, get(cave, x, y), x, y); + + // if using new engine, skip checking other direction (like "if ... else if ...") + check_both_directions = game_bd.game->use_old_engine; } - if (is_like_space(cave, x, y, GD_MV_RIGHT)) { + if (check_both_directions && is_like_space(cave, x, y, GD_MV_RIGHT)) + { store_dir(cave, x, y, GD_MV_RIGHT, get(cave, x, y)); play_sound_of_element(cave, get(cave, x, y), x, y); } } else { - if (is_like_space(cave, x, y, GD_MV_UP)) { + // special case: check both directions when using old engine + boolean check_both_directions = TRUE; + + if (check_both_directions && is_like_space(cave, x, y, GD_MV_UP)) + { store_dir(cave, x, y, GD_MV_UP, get(cave, x, y)); play_sound_of_element(cave, get(cave, x, y), x, y); + + // if using new engine, skip checking other direction (like "if ... else if ...") + check_both_directions = game_bd.game->use_old_engine; } - if (is_like_space(cave, x, y, GD_MV_DOWN)) { + if (check_both_directions && is_like_space(cave, x, y, GD_MV_DOWN)) + { store_dir(cave, x, y, GD_MV_DOWN, get(cave, x, y)); play_sound_of_element(cave, get(cave, x, y), x, y); }