Skip to content

Commit

Permalink
tr2/game-flow: initialise regular levels in gameflow
Browse files Browse the repository at this point in the history
  • Loading branch information
rr- committed Feb 1, 2025
1 parent 06e67e1 commit a162d31
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
12 changes: 0 additions & 12 deletions src/tr2/game/game.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,6 @@
bool Game_Start(const GF_LEVEL *const level, const GF_SEQUENCE_CONTEXT seq_ctx)
{
Game_SetCurrentLevel(level);
GF_SetCurrentLevel(level);
if (seq_ctx != GFSC_SAVED) {
if (level != nullptr) {
Savegame_ApplyLogicToCurrentInfo(level);
}
InitialiseLevelFlags();
}
if (!Level_Initialise(level, seq_ctx)) {
Game_SetCurrentLevel(nullptr);
GF_SetCurrentLevel(nullptr);
return false;
}

g_OverlayStatus = 1;
Camera_Initialise();
Expand Down
12 changes: 12 additions & 0 deletions src/tr2/game/game_flow/sequencer.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include "game/game_flow/sequencer.h"

#include "decomp/decomp.h"
#include "decomp/savegame.h"
#include "game/fmv.h"
#include "game/game.h"
Expand Down Expand Up @@ -79,6 +80,17 @@ static DECLARE_EVENT_HANDLER(M_HandlePlayLevel)
}
gf_cmd = GF_RunCutscene(level->num);
} else {
if (seq_ctx != GFSC_SAVED) {
if (level != nullptr) {
Savegame_ApplyLogicToCurrentInfo(level);
}
InitialiseLevelFlags();
}
if (!Level_Initialise(level, seq_ctx)) {
Game_SetCurrentLevel(nullptr);
GF_SetCurrentLevel(nullptr);
return (GF_COMMAND) { .action = GF_EXIT_TO_TITLE };
}
gf_cmd = GF_RunGame(level, seq_ctx);
}
if (gf_cmd.action == GF_LEVEL_COMPLETE) {
Expand Down

0 comments on commit a162d31

Please sign in to comment.