Read CCustomCarPlateMgr::GeneratePlateText from InjectDelayedPatches - adds compatibility with Deji's Custom Plate Format

This commit is contained in:
Silent 2017-04-27 16:17:38 +02:00
parent 3310e2eea1
commit ace01292eb
3 changed files with 16 additions and 2 deletions

View file

@ -7,10 +7,11 @@ static void* BaseModelInfoShutdown = AddressByVersion<void*>(0x4C4D50, 0x4C4DD0,
WRAPPER void CBaseModelInfo::Shutdown() { VARJMP(BaseModelInfoShutdown); }
RwTexture* (*CCustomCarPlateMgr::CreatePlateTexture)(const char* pText, signed char nDesign) = AddressByVersion<RwTexture*(*)(const char*,signed char)>(0x6FDEA0, 0x6FE6D0, 0x736AC0);
bool (*CCustomCarPlateMgr::GeneratePlateText)(char* pBuf, int nLen) = AddressByVersion<bool(*)(char*,int)>(0x6FD5B0, 0x6FDDE0, 0x7360F0);
signed char (*CCustomCarPlateMgr::GetMapRegionPlateDesign)() = AddressByVersion<signed char(*)()>(0x6FD7A0, 0x6FDFD0, 0x7363E0);
void (*CCustomCarPlateMgr::SetupMaterialPlatebackTexture)(RpMaterial* pMaterial, signed char nDesign) = AddressByVersion<void(*)(RpMaterial*,signed char)>(0x6FDE50, 0x6FE680, 0x736A80);
bool (*CCustomCarPlateMgr::GeneratePlateText)(char* pBuf, int nLen); // Read from InjectDelayedPatches
CBaseModelInfo** const ms_modelInfoPtrs = *AddressByVersion<CBaseModelInfo***>(0x509CB1, 0x4C0C96, 0x403DB7);
const uint32_t m_numModelInfoPtrs = *AddressByVersion<uint16_t*>(0x4C5956+2, 0, 0);

View file

@ -2484,6 +2484,10 @@ BOOL InjectDelayedPatches_10()
Patch<DWORD>(0x5B8EB0, 15000);
}
// Read CCustomCarPlateMgr::GeneratePlateText from here
// to work fine with Deji's Custom Plate Format
ReadCall( 0x4C9484, CCustomCarPlateMgr::GeneratePlateText );
// Adblocker
#if DISABLE_FLA_DONATION_WINDOW
if ( GetModuleHandleW(L"$fastman92limitAdjuster.asi") != nullptr )
@ -2715,6 +2719,11 @@ BOOL InjectDelayedPatches_11()
Patch<DWORD>(0x5B9690, 15000);
}
// Read CCustomCarPlateMgr::GeneratePlateText from here
// to work fine with Deji's Custom Plate Format
// Albeit 1.01 obfuscates this function
CCustomCarPlateMgr::GeneratePlateText = (decltype(CCustomCarPlateMgr::GeneratePlateText))0x6FDDE0;
return FALSE;
}
return TRUE;
@ -2922,6 +2931,10 @@ BOOL InjectDelayedPatches_Steam()
Patch<DWORD>(0x5D5780, 15000);
}
// Read CCustomCarPlateMgr::GeneratePlateText from here
// to work fine with Deji's Custom Plate Format
ReadCall( 0x4D3DA4, CCustomCarPlateMgr::GeneratePlateText );
return FALSE;
}
return TRUE;

View file

@ -6,7 +6,7 @@
<SILENTPATCH_EXT>.asi</SILENTPATCH_EXT>
<SILENTPATCH_FULL_NAME>SilentPatch for San Andreas</SILENTPATCH_FULL_NAME>
<SILENTPATCH_REVISION_ID>29</SILENTPATCH_REVISION_ID>
<SILENTPATCH_BUILD_ID>2</SILENTPATCH_BUILD_ID>
<SILENTPATCH_BUILD_ID>3</SILENTPATCH_BUILD_ID>
<SILENTPATCH_COPYRIGHT>2014-2017</SILENTPATCH_COPYRIGHT>
</PropertyGroup>
<PropertyGroup />