gta2 - hud fix (again)
@@ -179,6 +179,7 @@ DWORD WINAPI Init(LPVOID bDelay)
void operator()(injector::reg_pack& regs)
{
regs.ecx = 0x2F;
+
if (bFixHud)
*(int32_t*)(regs.ebp + 0x138) = Screen.nHudScale;
@@ -190,19 +191,20 @@ DWORD WINAPI Init(LPVOID bDelay)
}
}; injector::MakeInline<CameraZoom>(pattern.count(2).get(1).get<void*>(0));
- struct MissionHudFix
+ if (bFixHud)
+ {
+ pattern = hook::pattern("8B 0D ? ? ? ? 53 8B 5D 08 56 57"); //4CBA59
+ static auto dword_670684 = *pattern.get_first<uint32_t*>(2);
+ struct HUDHook
{
void operator()(injector::reg_pack& regs)
{
- regs.ecx = 0x2F;
- if (bFixHud)
- *(int32_t*)(regs.esi + 0xA8) = Screen.nHudScale;
+ regs.ecx = *dword_670684;
+ *(int32_t*)(regs.esi + 0x00) = Screen.nHudScale;
+ //*(int32_t*)(regs.esi - 0xBC) = Screen.nHudScale;
}
- }; injector::MakeInline<MissionHudFix>(pattern.count(2).get(0).get<void*>(0));
-
+ }; injector::MakeInline<HUDHook>(pattern.get_first(0), pattern.get_first(6));
- if (bFixHud)
- {
dword_6733F0 = *hook::pattern("68 ? ? ? ? 52 C7 05").get_first<uintptr_t>(1);
pattern = hook::pattern("83 3D ? ? ? ? 00 75 ? 68 ? ? ? ? 68 ? ? ? ? 8D 85 B0 FC FF FF");
