Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
run servicing while in WaitForInitLoop
this'll fix cases where D3D reinitializing (fullscreen<->windowed change, window resize, ...) while in the main menu would require use of Alt-F4 to resume executing the game.

Alt-F4, in this case, would load the warning screen, and due to an internal check in streaming, would call the same function we call, but only once.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=cf176f99853835c554f78534a6473ce5ec227fcf
  • Loading branch information
silicon authored and blattersturm committed Apr 17, 2017
1 parent 8821d21 commit 52b8079
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions components/gta-core-five/src/BlockLoadSetters.cpp
Expand Up @@ -45,13 +45,19 @@ bool g_shouldSetState;
bool g_isInInitLoop; // to avoid some GFx crash?
static bool g_shouldReloadGame;

static hook::cdecl_stub<void()> runCriticalSystemServicing([]()
{
return hook::get_call(hook::get_pattern("48 8D 0D ? ? ? ? BA 32 00 00 00 E8", 17));
});

static void WaitForInitLoop()
{
// run our loop
g_isInInitLoop = true;

while (*g_initState <= MapInitState(6))
{
runCriticalSystemServicing();
lookAlive();

if (*g_initState <= MapInitState(6))
Expand Down

0 comments on commit 52b8079

Please sign in to comment.