Skip to content

Commit

Permalink
Reverted GameReset in LoadGameHook.cpp to pre-4.1.4 behavior
Browse files Browse the repository at this point in the history
(when the engine's game_reset is called, sfall will reset modules as
well for consistency, closes #553)
  • Loading branch information
NovaRain committed Jun 29, 2024
1 parent d9b5910 commit dc35377
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions sfall/Modules/LoadGameHook.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -287,16 +287,15 @@ static bool LoadGame_Before() {

// called whenever game is being reset (prior to loading a save or when returning to main menu)
static bool __stdcall GameReset(DWORD isGameLoad) {
if (gameLoaded) { // prevent resetting when a new game has not been started (loading saved game from main menu)
onGameReset.invoke();
if (isDebug) {
char* str = (isGameLoad) ? "on Load" : "on Exit";
fo::func::debug_printf("\nSFALL: [State reset %s]\n", str);
}
}
onGameReset.invoke();
inLoop = 0;
gameLoaded = false;

if (isDebug) {
char* str = (isGameLoad) ? "on Load" : "on Exit";
fo::func::debug_printf("\nSFALL: [State reset %s]\n", str);
}

return (isGameLoad) ? LoadGame_Before() : false;
}

Expand Down

0 comments on commit dc35377

Please sign in to comment.