Skip to content

Commit

Permalink
add bool check for D3D needing reinit
Browse files Browse the repository at this point in the history
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=f7642dc111be8476738221b1b2c2d9c67081c695
  • Loading branch information
silicon authored and blattersturm committed Apr 17, 2017
1 parent 475dc3c commit 8821d21
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions components/rage-nutsnbolts-five/src/FrameHook.cpp
Expand Up @@ -68,6 +68,9 @@ static void DoGameFrame()
g_lastGameFrame = timeGetTime();
}

static bool* g_isD3DInvalid;

// actually: 'should exit game' function called by LookAlive
static bool OnLookAlive()
{
if (Instance<ICoreGameInit>::Get()->GetGameLoaded())
Expand Down Expand Up @@ -127,5 +130,9 @@ static HookFunction hookFunction([] ()
hook::set_call(&g_origFrameFunc, func);
hook::call(func, DoLoadsFrame);

location = hook::get_pattern<char>("84 C9 74 0D 38 05 ? ? ? ? 75 05 B8 01 00", 6);

g_isD3DInvalid = (bool*)(location + *(int32_t*)location + 4);

//__debugbreak();
});

0 comments on commit 8821d21

Please sign in to comment.