Skip to content

Commit

Permalink
Fixes a issue where PerformingLoad was not flagged when starting the …
Browse files Browse the repository at this point in the history
…loading process in Vinifera_Get_All.
  • Loading branch information
Rampastring authored and CCHyper committed Feb 10, 2023
1 parent fa8333c commit 850f118
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/vinifera/vinifera_hooks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ static void _Print_CRCs_Intercept(EventClass *ev)
}


#if 0
/**
* This function is for intercepting the call to Clear_Scenarion in Load_All
* to flag that we are performing a load operation, which stops the game from
Expand All @@ -120,6 +121,7 @@ static void _On_Load_Clear_Scenario_Intercept()
*/
Vinifera_PerformingLoad = true;
}
#endif


/**
Expand Down Expand Up @@ -998,5 +1000,5 @@ void Vinifera_Hooks()
Patch_Call(0x005B1363, &_Print_CRCs_Intercept);
Patch_Call(0x005B5340, &_Print_CRCs_Intercept);

Patch_Call(0x005D6BEC, &_On_Load_Clear_Scenario_Intercept); // Load_All
//Patch_Call(0x005D6BEC, &_On_Load_Clear_Scenario_Intercept); // Load_All
}
9 changes: 9 additions & 0 deletions src/vinifera/vinifera_saveload.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -479,6 +479,15 @@ bool Vinifera_Get_All(IStream *pStm, bool load_net)
DEBUG_INFO("About to call Clear_Scenario()...\n");
Clear_Scenario();

/**
* Now the scenario data has been cleaned up, we can now tell the extension
* hooks that we will be creating the extension classes via the class factories.
*
* Fixes #issue-951, this line was not copied over when the loading process
* was reimplemented.
*/
Vinifera_PerformingLoad = true;

/**
* Load the scenario global information.
*/
Expand Down

0 comments on commit 850f118

Please sign in to comment.