From: Holger Schemel Date: Sun, 13 Jun 2021 21:37:58 +0000 (+0200) Subject: moved setting auto-exit for Sokoban-style levels from runtime to level X-Git-Tag: 4.3.0.0~134 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=b4865a65808ffd72a4f98d09cdb332582e464500;p=rocksndiamonds.git moved setting auto-exit for Sokoban-style levels from runtime to level --- diff --git a/src/files.c b/src/files.c index 2a66964a..ac4bd38a 100644 --- a/src/files.c +++ b/src/files.c @@ -6131,6 +6131,7 @@ static void LoadLevelFromFileInfo_SB(struct LevelInfo *level, level->time = 0; level->use_step_counter = TRUE; + level->auto_exit_sokoban = TRUE; if (load_xsb_to_ces) { @@ -6490,6 +6491,7 @@ static void LoadLevel_InitSettings_SB(struct LevelInfo *level) // set special level settings for Sokoban levels level->time = 0; level->use_step_counter = TRUE; + level->auto_exit_sokoban = TRUE; } } diff --git a/src/game.c b/src/game.c index 574d394f..0dc37771 100644 --- a/src/game.c +++ b/src/game.c @@ -3542,7 +3542,6 @@ void InitGame(void) int fade_mask = REDRAW_FIELD; boolean emulate_bd = TRUE; // unless non-BOULDERDASH elements found - boolean emulate_sb = TRUE; // unless non-SOKOBAN elements found boolean emulate_sp = TRUE; // unless non-SUPAPLEX elements found int initial_move_dir = MV_DOWN; int i, j, x, y; @@ -3886,8 +3885,6 @@ void InitGame(void) { if (emulate_bd && !IS_BD_ELEMENT(Tile[x][y])) emulate_bd = FALSE; - if (emulate_sb && !IS_SB_ELEMENT(Tile[x][y])) - emulate_sb = FALSE; if (emulate_sp && !IS_SP_ELEMENT(Tile[x][y])) emulate_sp = FALSE; @@ -3912,7 +3909,6 @@ void InitGame(void) } game.emulation = (emulate_bd ? EMU_BOULDERDASH : - emulate_sb ? EMU_SOKOBAN : emulate_sp ? EMU_SUPAPLEX : EMU_NONE); // initialize type of slippery elements @@ -14527,7 +14523,7 @@ static int DigField(struct PlayerInfo *player, if (sokoban_task_solved && game.sokoban_fields_still_needed == 0 && game.sokoban_objects_still_needed == 0 && - (game.emulation == EMU_SOKOBAN || level.auto_exit_sokoban)) + level.auto_exit_sokoban) { game.players_still_needed = 0; diff --git a/src/main.h b/src/main.h index f0f2c530..575be5ac 100644 --- a/src/main.h +++ b/src/main.h @@ -2624,7 +2624,7 @@ enum // values for game_emulation #define EMU_NONE 0 #define EMU_BOULDERDASH 1 -#define EMU_SOKOBAN 2 +#define EMU_UNUSED_2 2 #define EMU_SUPAPLEX 3 // values for level file type identifier