mirror of
https://github.com/CookiePLMonster/SilentPatch.git
synced 2025-01-31 06:57:28 +05:00
III/VC: Added EnableVehicleCoronaFixes INI option
This commit is contained in:
parent
1d007aed68
commit
c1ccfba2ec
3 changed files with 20 additions and 19 deletions
|
@ -226,21 +226,6 @@ namespace Common {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Corrected taxi light placement for Taxi
|
|
||||||
// TODO: INI entry
|
|
||||||
{
|
|
||||||
using namespace TaxiCoronaFix;
|
|
||||||
|
|
||||||
auto getTaxiLightPos = pattern( "E8 ? ? ? ? D9 84 24 ? ? ? ? D8 84 24 ? ? ? ? 83 C4 0C FF 35" );
|
|
||||||
|
|
||||||
if ( getTaxiLightPos.count_hint(1).size() == 1 )
|
|
||||||
{
|
|
||||||
auto match = getTaxiLightPos.get_one();
|
|
||||||
Patch<uint8_t>( match.get<void>( -15 ), 0x55 ); // push eax -> push ebp
|
|
||||||
InjectHook( match.get<void>(), GetTransformedCoronaPos );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// Reset requested extras if created vehicle has no extras
|
// Reset requested extras if created vehicle has no extras
|
||||||
{
|
{
|
||||||
|
@ -257,9 +242,25 @@ namespace Common {
|
||||||
DelayedPatches::Func = std::move(func);
|
DelayedPatches::Func = std::move(func);
|
||||||
}
|
}
|
||||||
|
|
||||||
void III_VC_DelayedCommon( bool /*hasDebugMenu*/, const wchar_t* /*iniPath*/ )
|
void III_VC_DelayedCommon( bool /*hasDebugMenu*/, const wchar_t* wcModulePath )
|
||||||
{
|
{
|
||||||
|
using namespace Memory;
|
||||||
|
using namespace hook;
|
||||||
|
|
||||||
|
// Corrected taxi light placement for Taxi
|
||||||
|
if ( GetPrivateProfileIntW(L"SilentPatch", L"EnableVehicleCoronaFixes", -1, wcModulePath) == 1 )
|
||||||
|
{
|
||||||
|
using namespace TaxiCoronaFix;
|
||||||
|
|
||||||
|
auto getTaxiLightPos = pattern( "E8 ? ? ? ? D9 84 24 ? ? ? ? D8 84 24 ? ? ? ? 83 C4 0C FF 35" );
|
||||||
|
|
||||||
|
if ( getTaxiLightPos.count_hint(1).size() == 1 )
|
||||||
|
{
|
||||||
|
auto match = getTaxiLightPos.get_one();
|
||||||
|
Patch<uint8_t>( match.get<void>( -15 ), 0x55 ); // push eax -> push ebp
|
||||||
|
InjectHook( match.get<void>(), GetTransformedCoronaPos );
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -524,7 +524,7 @@ void InjectDelayedPatches_III_Common( bool bHasDebugMenu, const wchar_t* wcModul
|
||||||
|
|
||||||
|
|
||||||
// Corrected siren corona placement for emergency vehicles
|
// Corrected siren corona placement for emergency vehicles
|
||||||
// TODO: INI entry
|
if ( GetPrivateProfileIntW(L"SilentPatch", L"EnableVehicleCoronaFixes", -1, wcModulePath) == 1 )
|
||||||
{
|
{
|
||||||
// Other mods might be touching it, so only patch specific vehicles if their code has not been touched at all
|
// Other mods might be touching it, so only patch specific vehicles if their code has not been touched at all
|
||||||
{
|
{
|
||||||
|
|
|
@ -455,7 +455,7 @@ void InjectDelayedPatches_VC_Common( bool bHasDebugMenu, const wchar_t* wcModule
|
||||||
|
|
||||||
|
|
||||||
// Corrected siren corona placement for emergency vehicles
|
// Corrected siren corona placement for emergency vehicles
|
||||||
// TODO: INI entry
|
if ( GetPrivateProfileIntW(L"SilentPatch", L"EnableVehicleCoronaFixes", -1, wcModulePath) == 1 )
|
||||||
{
|
{
|
||||||
// Other mods might be touching it, so only patch specific vehicles if their code has not been touched at all
|
// Other mods might be touching it, so only patch specific vehicles if their code has not been touched at all
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue