diff --git a/SilentPatchSA/SilentPatchSA.cpp b/SilentPatchSA/SilentPatchSA.cpp index 2310727..493cbbe 100644 --- a/SilentPatchSA/SilentPatchSA.cpp +++ b/SilentPatchSA/SilentPatchSA.cpp @@ -3438,6 +3438,11 @@ void Patch_SA_10() InjectHook(0x6C7E7A, &CAutomobile::PreRender_Stub); InjectHook(0x6CEAEC, &CAutomobile::PreRender_Stub); InjectHook(0x6CFADC, &CAutomobile::PreRender_Stub); + + + // Stop BF Injection/Bandito/Hotknife rotating engine components when engine is off + Patch(0x6AC2BE + 2, &CAutomobile::ms_engineCompSpeed); + Patch(0x6ACB91 + 2, &CAutomobile::ms_engineCompSpeed); } void Patch_SA_11() diff --git a/SilentPatchSA/VehicleSA.cpp b/SilentPatchSA/VehicleSA.cpp index abd9d37..5ede546 100644 --- a/SilentPatchSA/VehicleSA.cpp +++ b/SilentPatchSA/VehicleSA.cpp @@ -9,6 +9,8 @@ std::vector vecRotorExceptions; +float CAutomobile::ms_engineCompSpeed; + static bool ShouldIgnoreRotor( int32_t id ) { return std::find( vecRotorExceptions.begin(), vecRotorExceptions.end(), id ) != vecRotorExceptions.end(); @@ -278,6 +280,9 @@ void CPlane::Fix_SilentPatch() void CAutomobile::PreRender() { + // For rotating engine components + ms_engineCompSpeed = m_nVehicleFlags.bEngineOn ? CTimer::m_fTimeStep : 0.0f; + (this->*(orgPreRender))(); if ( FLAUtils::GetExtendedID( &m_nModelIndex ) == 603 ) diff --git a/SilentPatchSA/VehicleSA.h b/SilentPatchSA/VehicleSA.h index 4005eeb..37a92dc 100644 --- a/SilentPatchSA/VehicleSA.h +++ b/SilentPatchSA/VehicleSA.h @@ -173,7 +173,8 @@ public: void ProcessPhoenixBlower( int32_t modelID ); void ProcessSweeper(); - static void (CAutomobile::*orgPreRender)(); + static void (CAutomobile::*orgPreRender)(); + static float ms_engineCompSpeed; }; class NOVMT CHeli : public CAutomobile