Skip to content

Commit 3e66490

Browse files
authored
Fix beacon load again (#41)
* Revert "Update Beacon Load" This reverts commit e243a9e. * Fix weird revert
1 parent cbd6f17 commit 3e66490

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

src/Spawner/Spawner.Hook.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222

2323
#include <HouseClass.h>
2424
#include <SessionClass.h>
25+
#include <BeaconManagerClass.h>
2526
#include <Utilities/Debug.h>
2627
#include <Utilities/Macro.h>
2728
#include <Unsorted.h>
@@ -223,8 +224,14 @@ DEFINE_HOOK(0x686B20, INIClass_ReadScenario_AutoSave, 0x6)
223224
DEFINE_HOOK(0x4C7A14, EventClass_RespondToEvent_SaveGame, 0x5)
224225
{
225226
Spawner::RespondToSaveGame();
226-
227227
return 0x4C7B42;
228228
}
229229

230+
// for some reason beacons are only inited on scenario init, which doesn't happen on load
231+
DEFINE_HOOK(0x67E6DA, LoadGame_AfterInit, 0x6)
232+
{
233+
BeaconManagerClass::Instance.LoadArt();
234+
return 0;
235+
}
236+
230237
#pragma endregion

src/Spawner/Spawner.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,18 +25,17 @@
2525
#include <Utilities/Debug.h>
2626
#include <Utilities/DumperTypes.h>
2727

28-
#include <BeaconManagerClass.h>
2928
#include <GameOptionsClass.h>
3029
#include <GameStrings.h>
3130
#include <HouseClass.h>
3231
#include <IPXManagerClass.h>
3332
#include <LoadOptionsClass.h>
33+
#include <WWMessageBox.h>
3434
#include <MPGameModeClass.h>
3535
#include <ScenarioClass.h>
3636
#include <time.h>
3737
#include <UDPInterfaceClass.h>
3838
#include <Unsorted.h>
39-
#include <WWMessageBox.h>
4039
#include <WWMouseClass.h>
4140

4241
bool Spawner::Enabled = false;
@@ -352,9 +351,6 @@ bool Spawner::StartScenario(const char* pScenarioName)
352351

353352
bool Spawner::LoadSavedGame(const char* saveGameName)
354353
{
355-
// for some reason beacons are only inited on scenario init, which doesn't happen on load
356-
BeaconManagerClass::Instance.LoadArt();
357-
358354
if (!saveGameName[0] || !LoadOptionsClass::LoadMission(saveGameName))
359355
{
360356
Debug::Log("[Spawner] Failed Load Game [%s]\n", saveGameName);

0 commit comments

Comments
 (0)