From: Holger Schemel Date: Wed, 3 Jul 2024 08:39:21 +0000 (+0200) Subject: added support for zero delay for gravitation switch in BD engine X-Git-Tag: 4.4.0.0-test-3~6 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=bb08733e9e29036d8fda5f0865c0a207da466579;p=rocksndiamonds.git added support for zero delay for gravitation switch in BD engine --- diff --git a/src/editor.c b/src/editor.c index 77f8d328..539bce3b 100644 --- a/src/editor.c +++ b/src/editor.c @@ -12199,7 +12199,7 @@ static struct 0, 10 }, { EL_BDX_CREATURE_SWITCH, &level.bd_creatures_auto_turn_delay, TEXT_AUTO_TURN_DELAY }, { EL_BDX_GRAVITY_SWITCH, &level.bd_gravity_switch_delay, TEXT_GRAVITY_DELAY, - 1, 60 }, + 0, 60 }, { EL_EXTRA_TIME, &level.extra_time, TEXT_TIME_BONUS }, { EL_TIME_ORB_FULL, &level.time_orb_time, TEXT_TIME_BONUS }, { EL_GAME_OF_LIFE, &level.game_of_life[0], TEXT_GAME_OF_LIFE_1,0,8 }, diff --git a/src/game_bd/bd_caveengine.c b/src/game_bd/bd_caveengine.c index 85d92411..a5a18787 100644 --- a/src/game_bd/bd_caveengine.c +++ b/src/game_bd/bd_caveengine.c @@ -1855,8 +1855,9 @@ void gd_cave_iterate(GdCave *cave, GdDirection player_move, boolean player_fire, player_move == GD_MV_DOWN)) { gd_sound_play(cave, GD_S_SWITCH_GRAVITY, what, x, y); + // (use 1 instead of 0 for immediate gravitation change) cave->gravity_will_change = - cave->gravity_change_time * cave->timing_factor; + MAX(1, cave->gravity_change_time * cave->timing_factor); cave->gravity_next_direction = player_move; cave->gravity_switch_active = FALSE; } @@ -1961,8 +1962,9 @@ void gd_cave_iterate(GdCave *cave, GdDirection player_move, boolean player_fire, player_move == GD_MV_DOWN)) { gd_sound_play(cave, GD_S_SWITCH_GRAVITY, what, x, y); + // (use 1 instead of 0 for immediate gravitation change) cave->gravity_will_change = - cave->gravity_change_time * cave->timing_factor; + MAX(1, cave->gravity_change_time * cave->timing_factor); cave->gravity_next_direction = player_move; cave->gravity_switch_active = FALSE; }