Skip to content

Commit

Permalink
Merge branch 'ThirteenAG:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
SandeMC committed Jan 14, 2024
2 parents 1d44c0c + 7236bd7 commit f913bb8
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion source/framelimit.ixx
Original file line number Diff line number Diff line change
Expand Up @@ -154,10 +154,20 @@ void __cdecl sub_855640()
}
}

bool bIsC64CB0XRef = false;
injector::hook_back<void(__cdecl*)(void*)> hbsub_C64CB0;
void __cdecl sub_C64CB0(void* a1)
{
bIsC64CB0XRef = true;
hbsub_C64CB0.fun(a1);
bIsC64CB0XRef = false;
}

SafetyHookInline CCutsceneObjectHook{};
void __fastcall sub_C64380(void* _this, void* edx)
{
LoadingFpsLimiter.Sync();
if (bIsC64CB0XRef)
LoadingFpsLimiter.Sync();
return CCutsceneObjectHook.unsafe_fastcall(_this, edx);
}

Expand Down Expand Up @@ -245,6 +255,10 @@ public:
auto pattern = hook::pattern("56 8B F1 83 BE ? ? ? ? ? C7 06 ? ? ? ? 0F 85");
if (!pattern.empty())
CCutsceneObjectHook = safetyhook::create_inline(pattern.get_first(0), sub_C64380);

pattern = hook::pattern("E8 ? ? ? ? 83 C4 0C C7 04 B5 ? ? ? ? ? ? ? ? 4E");
if (!pattern.empty())
hbsub_C64CB0.fun = injector::MakeCALL(pattern.get_first(0), sub_C64CB0).get();
};

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

0 comments on commit f913bb8

Please sign in to comment.