mirror of
https://github.com/CookiePLMonster/SilentPatch.git
synced 2024-12-28 23:03:01 +05:00
Enable Dodo keyboard controls for all cars when the flying cars cheat is enabled
This commit is contained in:
parent
5a99b6a4d8
commit
2eab47968c
1 changed files with 34 additions and 0 deletions
|
@ -630,6 +630,28 @@ namespace StatsMenuFont
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ============= Enable Dodo keyboard controls for all cars when the flying cars cheat is enabled =============
|
||||||
|
namespace DodoKeyboardControls
|
||||||
|
{
|
||||||
|
static bool* bAllDodosCheat;
|
||||||
|
|
||||||
|
static void* (*orgFindPlayerVehicle)();
|
||||||
|
__declspec(naked) static void FindPlayerVehicle_DodoCheck()
|
||||||
|
{
|
||||||
|
_asm
|
||||||
|
{
|
||||||
|
call [orgFindPlayerVehicle]
|
||||||
|
mov ecx, [bAllDodosCheat]
|
||||||
|
cmp byte ptr [ecx], 0
|
||||||
|
je CheatDisabled
|
||||||
|
mov byte ptr [esp+1Ch-14h], 1
|
||||||
|
|
||||||
|
CheatDisabled:
|
||||||
|
retn
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void InjectDelayedPatches_III_Common( bool bHasDebugMenu, const wchar_t* wcModulePath )
|
void InjectDelayedPatches_III_Common( bool bHasDebugMenu, const wchar_t* wcModulePath )
|
||||||
{
|
{
|
||||||
|
@ -1497,6 +1519,18 @@ void Patch_III_Common()
|
||||||
InterceptCall(constructStatLine.get_first<void>(), orgConstructStatLine, ConstructStatLine_SetFontStyle);
|
InterceptCall(constructStatLine.get_first<void>(), orgConstructStatLine, ConstructStatLine_SetFontStyle);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Enable Dodo keyboard controls for all cars when the flying cars cheat is enabled
|
||||||
|
{
|
||||||
|
using namespace DodoKeyboardControls;
|
||||||
|
|
||||||
|
auto findPlayerVehicle = get_pattern("E8 ? ? ? ? 0F BF 40 5C 83 F8 7E");
|
||||||
|
auto allDodosCheat = *get_pattern<bool*>("80 3D ? ? ? ? ? 74 5B", 2);
|
||||||
|
|
||||||
|
bAllDodosCheat = allDodosCheat;
|
||||||
|
InterceptCall(findPlayerVehicle, orgFindPlayerVehicle, FindPlayerVehicle_DodoCheck);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
|
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
|
||||||
|
|
Loading…
Reference in a new issue