Reinit CGarages::RespraysAreFree - III/VC

This commit is contained in:
Silent 2016-05-29 22:59:15 +02:00
parent 0b2fc37d06
commit e96bd3e91c
2 changed files with 52 additions and 0 deletions

View file

@ -424,6 +424,18 @@ void Patch_III_10(const RECT& desktop)
InjectHook(0x48C4FB, CarCtrlReInit_SilentPatch);
// Reinit free resprays flag
// add esp, 38h
// mov CGarages::RespraysAreFree, 0
// retn
bool* pFreeResprays = *(bool**)0x4224A4;
Patch<BYTE>(0x421E06, 0x38);
Patch<WORD>(0x421E07, 0x05C6);
Patch<const void*>(0x421E09, pFreeResprays);
Patch<BYTE>(0x421E0E, 0xC3);
// Adblocker
#if DISABLE_FLA_DONATION_WINDOW
if ( *(DWORD*)0x582749 != 0x006A026A )
@ -569,6 +581,17 @@ void Patch_III_11(const RECT& desktop)
int pCarCtrlReInit = 0x48C5FB;
orgCarCtrlReInit = (void(*)())(*(int*)(pCarCtrlReInit+1) + pCarCtrlReInit + 5);
InjectHook(0x48C5FB, CarCtrlReInit_SilentPatch);
// Reinit free resprays flag
// add esp, 38h
// mov CGarages::RespraysAreFree, 0
// retn
bool* pFreeResprays = *(bool**)0x4224A4;
Patch<BYTE>(0x421E06, 0x38);
Patch<WORD>(0x421E07, 0x05C6);
Patch<const void*>(0x421E09, pFreeResprays);
Patch<BYTE>(0x421E0E, 0xC3);
}
void Patch_III_Steam(const RECT& desktop)
@ -702,6 +725,17 @@ void Patch_III_Steam(const RECT& desktop)
int pCarCtrlReInit = 0x48C58B;
orgCarCtrlReInit = (void(*)())(*(int*)(pCarCtrlReInit+1) + pCarCtrlReInit + 5);
InjectHook(0x48C58B, CarCtrlReInit_SilentPatch);
// Reinit free resprays flag
// add esp, 38h
// mov CGarages::RespraysAreFree, 0
// retn
bool* pFreeResprays = *(bool**)0x4224A4;
Patch<BYTE>(0x421E06, 0x38);
Patch<WORD>(0x421E07, 0x05C6);
Patch<const void*>(0x421E09, pFreeResprays);
Patch<BYTE>(0x421E0E, 0xC3);
}
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)

View file

@ -184,6 +184,12 @@ void CarCtrlReInit_SilentPatch()
LastTimeAmbulanceCreated = 0;
}
static bool& RespraysAreFree = **AddressByVersion<bool**>(0x430D17, 0x430D17, 0x430CE7);
void GaragesInit_SilentPatch()
{
RespraysAreFree = false;
}
static char aNoDesktopMode[64];
void Patch_VC_10(const RECT& desktop)
@ -318,6 +324,10 @@ void Patch_VC_10(const RECT& desktop)
InjectHook(0x4A489B, CarCtrlReInit_SilentPatch);
// Reinit free resprays flag
InjectHook(0x4349BB, GaragesInit_SilentPatch, PATCH_JUMP);
// Adblocker
#if DISABLE_FLA_DONATION_WINDOW
if ( *(DWORD*)0x5FFAE9 != 0x006A026A )
@ -458,6 +468,10 @@ void Patch_VC_11(const RECT& desktop)
int pCarCtrlReInit = 0x4A48BB;
orgCarCtrlReInit = (void(*)())(*(int*)(pCarCtrlReInit+1) + pCarCtrlReInit + 5);
InjectHook(0x4A48BB, CarCtrlReInit_SilentPatch);
// Reinit free resprays flag
InjectHook(0x4349BB, GaragesInit_SilentPatch, PATCH_JUMP);
}
void Patch_VC_Steam(const RECT& desktop)
@ -589,6 +603,10 @@ void Patch_VC_Steam(const RECT& desktop)
int pCarCtrlReInit = 0x4A475B;
orgCarCtrlReInit = (void(*)())(*(int*)(pCarCtrlReInit+1) + pCarCtrlReInit + 5);
InjectHook(0x4A475B, CarCtrlReInit_SilentPatch);
// Reinit free resprays flag
InjectHook(0x43497B, GaragesInit_SilentPatch, PATCH_JUMP);
}
void Patch_VC_JP()