From: Holger Schemel Date: Mon, 16 Sep 2024 17:55:18 +0000 (+0200) Subject: changed BD engine to match new GDash code (conveyor belts) X-Git-Tag: 4.4.0.0-test-4~229 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=298369b77475aff6897d60954c5e3fa168ffe1e0;p=rocksndiamonds.git changed BD engine to match new GDash code (conveyor belts) --- diff --git a/src/game_bd/bd_caveengine.c b/src/game_bd/bd_caveengine.c index 4f4ac8eb..d8e54132 100644 --- a/src/game_bd/bd_caveengine.c +++ b/src/game_bd/bd_caveengine.c @@ -3615,25 +3615,21 @@ void gd_cave_iterate(GdCave *cave, GdDirection player_move, boolean player_fire, // first, check for gravity and running belts. if (!cave->gravity_disabled && cave->conveyor_belts_active) { - const GdDirection *dir; - boolean left; - // decide direction - left = get(cave, x, y) != O_CONVEYOR_RIGHT; + boolean left = (get(cave, x, y) != O_CONVEYOR_RIGHT); if (cave->conveyor_belts_direction_changed) left = !left; - dir = left ? ccw_eighth : cw_eighth; + + const GdDirection *dir = (left ? ccw_eighth : cw_eighth); // CHECK IF IT CONVEYS THE ELEMENT ABOVE IT - // if gravity is normal, and the conveyor belt has something - // ABOVE which can be moved + // + // if gravity is normal, and the conveyor belt has something ABOVE which can be moved // OR - // the gravity is up, so anything that should float now goes - // DOWN and touches the conveyor - if ((cave->gravity == GD_MV_DOWN && - moved_by_conveyor_top(cave, x, y, GD_MV_UP)) || - (cave->gravity == GD_MV_UP && - moved_by_conveyor_bottom(cave, x, y, GD_MV_UP))) + // the gravity is up, so anything that should float now goes DOWN and touches the + // conveyor + if ((cave->gravity == GD_MV_DOWN && moved_by_conveyor_top(cave, x, y, GD_MV_UP)) || + (cave->gravity == GD_MV_UP && moved_by_conveyor_bottom(cave, x, y, GD_MV_UP))) { if (is_like_space(cave, x, y, dir[GD_MV_UP])) { @@ -3662,10 +3658,8 @@ void gd_cave_iterate(GdCave *cave, GdDirection player_move, boolean player_fire, } // CHECK IF IT CONVEYS THE ELEMENT BELOW IT - if ((cave->gravity == GD_MV_UP && - moved_by_conveyor_top(cave, x, y, GD_MV_DOWN)) || - (cave->gravity == GD_MV_DOWN && - moved_by_conveyor_bottom(cave, x, y, GD_MV_DOWN))) + if ((cave->gravity == GD_MV_UP && moved_by_conveyor_top(cave, x, y, GD_MV_DOWN)) || + (cave->gravity == GD_MV_DOWN && moved_by_conveyor_bottom(cave, x, y, GD_MV_DOWN))) { if (is_like_space(cave, x, y, dir[GD_MV_DOWN])) {