diff --git a/src/tr2/game/game_flow/sequencer.c b/src/tr2/game/game_flow/sequencer.c index 7a567a0b6..e5809a273 100644 --- a/src/tr2/game/game_flow/sequencer.c +++ b/src/tr2/game/game_flow/sequencer.c @@ -70,12 +70,12 @@ static DECLARE_EVENT_HANDLER(M_HandlePlayLevel) if (seq_ctx == GFSC_STORY) { return gf_cmd; } else if (level->type == GFL_DEMO) { - if (!Level_Initialise(level, seq_ctx)) { + if (!Level_Initialise(level)) { return (GF_COMMAND) { .action = GF_EXIT_TO_TITLE }; } gf_cmd = GF_RunDemo(level->num); } else if (level->type == GFL_CUTSCENE) { - if (!Level_Initialise(level, seq_ctx)) { + if (!Level_Initialise(level)) { return (GF_COMMAND) { .action = GF_EXIT_TO_TITLE }; } gf_cmd = GF_RunCutscene(level->num); @@ -86,11 +86,16 @@ static DECLARE_EVENT_HANDLER(M_HandlePlayLevel) } InitialiseLevelFlags(); } - if (!Level_Initialise(level, seq_ctx)) { + if (!Level_Initialise(level)) { Game_SetCurrentLevel(nullptr); GF_SetCurrentLevel(nullptr); return (GF_COMMAND) { .action = GF_EXIT_TO_TITLE }; } + if (seq_ctx == GFSC_SAVED) { + ExtractSaveGameInfo(); + } else if (level->type == GFL_NORMAL) { + GF_InventoryModifier_Apply(Game_GetCurrentLevel(), GF_INV_REGULAR); + } gf_cmd = GF_RunGame(level, seq_ctx); } if (gf_cmd.action == GF_LEVEL_COMPLETE) { diff --git a/src/tr2/game/game_flow/sequencer_misc.c b/src/tr2/game/game_flow/sequencer_misc.c index 43812ff69..666522f81 100644 --- a/src/tr2/game/game_flow/sequencer_misc.c +++ b/src/tr2/game/game_flow/sequencer_misc.c @@ -15,7 +15,7 @@ GF_COMMAND GF_RunTitle(void) Savegame_UnbindSlot(); GameStringTable_Apply(nullptr); const GF_LEVEL *const title_level = GF_GetTitleLevel(); - if (!Level_Initialise(title_level, GFSC_NORMAL)) { + if (!Level_Initialise(title_level)) { return (GF_COMMAND) { .action = GF_EXIT_GAME }; } return GF_ShowInventory(INV_TITLE_MODE); diff --git a/src/tr2/game/level.c b/src/tr2/game/level.c index bc342d1ff..0542ce56a 100644 --- a/src/tr2/game/level.c +++ b/src/tr2/game/level.c @@ -714,10 +714,9 @@ bool Level_Load(const GF_LEVEL *const level) return true; } -bool Level_Initialise( - const GF_LEVEL *const level, const GF_SEQUENCE_CONTEXT seq_ctx) +bool Level_Initialise(const GF_LEVEL *const level) { - LOG_DEBUG("num=%d type=%d seq_ctx=%d", level->num, level->type, seq_ctx); + LOG_DEBUG("num=%d type=%d", level->num, level->type); if (level->type == GFL_DEMO) { Random_SeedDraw(0xD371F947); Random_SeedControl(0xD371F947); @@ -747,21 +746,13 @@ bool Level_Initialise( if (g_Lara.item_num != NO_ITEM) { Lara_Initialise(level); } - if (level->type == GFL_NORMAL || level->type == GFL_DEMO - || seq_ctx == GFSC_SAVED) { - GetCarriedItems(); - } + GetCarriedItems(); Effect_InitialiseArray(); LOT_InitialiseArray(); Overlay_Reset(); g_HealthBarTimer = 100; Sound_StopAll(); - if (seq_ctx == GFSC_SAVED) { - ExtractSaveGameInfo(); - } else if (level->type == GFL_NORMAL) { - GF_InventoryModifier_Apply(Game_GetCurrentLevel(), GF_INV_REGULAR); - } if (g_Objects[O_FINAL_LEVEL_COUNTER].loaded) { InitialiseFinalLevel(); diff --git a/src/tr2/game/level.h b/src/tr2/game/level.h index 5a6825b92..e3754841c 100644 --- a/src/tr2/game/level.h +++ b/src/tr2/game/level.h @@ -4,6 +4,6 @@ #include -bool Level_Initialise(const GF_LEVEL *level, GF_SEQUENCE_CONTEXT seq_ctx); +bool Level_Initialise(const GF_LEVEL *level); bool Level_Load(const GF_LEVEL *level); void Level_Unload(void);