Skip to content

Commit

Permalink
Fixed the music not playing after loading a saved game (#422)
Browse files Browse the repository at this point in the history
* if the save is on the same map, and while in the game.
  • Loading branch information
NovaRain committed Jan 19, 2022
1 parent f77cd85 commit d2b3529
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions sfall/Modules/LoadGameHook.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
#include "LoadOrder.h"
#include "Message.h"
#include "MetaruleExtender.h"
#include "MiscPatches.h"
#include "Movies.h"
#include "Objects.h"
#include "PartyControl.h"
Expand Down Expand Up @@ -283,6 +284,7 @@ static bool __stdcall GameReset(DWORD isGameLoad) {
Interface::OnGameLoad();
Worldmap::OnGameLoad();
Sound::OnGameLoad();
MiscPatches::OnGameLoad();
Inventory::Reset();
Objects::OnGameLoad();
Stats::OnGameLoad();
Expand Down
4 changes: 4 additions & 0 deletions sfall/Modules/MiscPatches.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -935,6 +935,10 @@ static void EngineOptimizationPatches() {
SafeWrite8(0x47C135, 140 + 10); // jz 0x47C1CF
}

void MiscPatches::OnGameLoad() {
cMusicArea = -1;
}

void MiscPatches::init() {
EngineOptimizationPatches();

Expand Down
2 changes: 2 additions & 0 deletions sfall/Modules/MiscPatches.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ class MiscPatches {
static const char* name() { return "MiscPatches"; }
static void init();
static void exit();

static void OnGameLoad();
};

}

0 comments on commit d2b3529

Please sign in to comment.