Skip to content

Commit

Permalink
move loading limiter to game init
Browse files Browse the repository at this point in the history
- this will keep startup times unaffected
  • Loading branch information
ThirteenAG committed Jan 12, 2024
1 parent b711c02 commit 4867c2a
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions source/framelimit.ixx
Original file line number Diff line number Diff line change
Expand Up @@ -157,10 +157,10 @@ void __cdecl sub_855640()
bool __cdecl sub_403CD0(HANDLE hHandle, DWORD dwMilliseconds)
{
if (CMenuManager__m_MenuActive)
{
{
if (!*CMenuManager__m_MenuActive)
LoadingFpsLimiter.Sync();
}
}
return hHandle && WaitForSingleObject(hHandle, dwMilliseconds) == WAIT_OBJECT_0;
}

Expand Down Expand Up @@ -240,17 +240,18 @@ public:
}
}; injector::MakeInline<SetFOVHook>(pattern.get_first(0), pattern.get_first(6));
}
};

FusionFix::onGameInitEvent() += []()
{
// Off Route infinite loading
{
auto pattern = hook::pattern("E8 ? ? ? ? 83 C4 08 84 C0 74 E2");
if (!pattern.empty())
injector::MakeCALL(pattern.get_first(), sub_403CD0, true);
auto pattern = hook::pattern("E8 ? ? ? ? 83 C4 08 84 C0 74 E2");
if (!pattern.empty())
injector::MakeCALL(pattern.get_first(), sub_403CD0, true);

pattern = hook::pattern("E8 ? ? ? ? 83 C4 0C 84 C0 75 25");
if (!pattern.empty())
injector::MakeCALL(pattern.get_first(), sub_403CD0, true);
}
pattern = hook::pattern("E8 ? ? ? ? 83 C4 0C 84 C0 75 25");
if (!pattern.empty())
injector::MakeCALL(pattern.get_first(), sub_403CD0, true);
};

FusionFix::onShutdownEvent() += []()
Expand Down

0 comments on commit 4867c2a

Please sign in to comment.