From 298369b77475aff6897d60954c5e3fa168ffe1e0 Mon Sep 17 00:00:00 2001 From: Holger Schemel Date: Mon, 16 Sep 2024 19:55:18 +0200 Subject: [PATCH] changed BD engine to match new GDash code (conveyor belts) --- src/game_bd/bd_caveengine.c | 28 +++++++++++----------------- 1 file changed, 11 insertions(+), 17 deletions(-) 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])) { -- 2.34.1