diff --git a/SilentPatch/Common.cpp b/SilentPatch/Common.cpp index 11b95cb..899bd9c 100644 --- a/SilentPatch/Common.cpp +++ b/SilentPatch/Common.cpp @@ -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( match.get( -15 ), 0x55 ); // push eax -> push ebp - InjectHook( match.get(), GetTransformedCoronaPos ); - } - } - // Reset requested extras if created vehicle has no extras { @@ -257,9 +242,25 @@ namespace Common { 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( match.get( -15 ), 0x55 ); // push eax -> push ebp + InjectHook( match.get(), GetTransformedCoronaPos ); + } + } } } } \ No newline at end of file diff --git a/SilentPatchIII/SilentPatchIII.cpp b/SilentPatchIII/SilentPatchIII.cpp index 7b78da0..6c25d91 100644 --- a/SilentPatchIII/SilentPatchIII.cpp +++ b/SilentPatchIII/SilentPatchIII.cpp @@ -524,7 +524,7 @@ void InjectDelayedPatches_III_Common( bool bHasDebugMenu, const wchar_t* wcModul // 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 { diff --git a/SilentPatchVC/SilentPatchVC.cpp b/SilentPatchVC/SilentPatchVC.cpp index 06df663..4cd6567 100644 --- a/SilentPatchVC/SilentPatchVC.cpp +++ b/SilentPatchVC/SilentPatchVC.cpp @@ -455,7 +455,7 @@ void InjectDelayedPatches_VC_Common( bool bHasDebugMenu, const wchar_t* wcModule // 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 {