From aeb9a76e00ad91fd4ac94c8c2c945f08e9ff0a6f Mon Sep 17 00:00:00 2001 From: Silent Date: Tue, 5 Jun 2018 21:07:42 +0200 Subject: [PATCH] Tug tow bar --- SilentPatchSA/SilentPatchSA.cpp | 5 +++++ SilentPatchSA/VehicleSA.cpp | 10 ++++++++++ SilentPatchSA/VehicleSA.h | 1 + 3 files changed, 16 insertions(+) diff --git a/SilentPatchSA/SilentPatchSA.cpp b/SilentPatchSA/SilentPatchSA.cpp index d17a7ac..5396010 100644 --- a/SilentPatchSA/SilentPatchSA.cpp +++ b/SilentPatchSA/SilentPatchSA.cpp @@ -3753,6 +3753,11 @@ void Patch_SA_10() // DFT-30 wheel, Sweeper brushes and other typos in hierarchy InjectHook( 0x4C5311, HierarchyTypoFix::strcasecmp ); + + + // Tug tow bar (misc_b instead of misc_a + Nop( 0x6AF2CC, 1 ); + InjectHook( 0x6AF2CC + 1, &CAutomobile::GetTowBarFrame, PATCH_CALL ); } void Patch_SA_11() diff --git a/SilentPatchSA/VehicleSA.cpp b/SilentPatchSA/VehicleSA.cpp index 1066a91..c798dce 100644 --- a/SilentPatchSA/VehicleSA.cpp +++ b/SilentPatchSA/VehicleSA.cpp @@ -480,6 +480,16 @@ void CPlane::PreRender() } } +RwFrame* CAutomobile::GetTowBarFrame() const +{ + RwFrame* towBar = m_pCarNode[20]; + if ( towBar == nullptr ) + { + towBar = m_pCarNode[21]; + } + return towBar; +} + void CAutomobile::PreRender() { // For rotating engine components diff --git a/SilentPatchSA/VehicleSA.h b/SilentPatchSA/VehicleSA.h index e870b23..c60d1a5 100644 --- a/SilentPatchSA/VehicleSA.h +++ b/SilentPatchSA/VehicleSA.h @@ -294,6 +294,7 @@ public: virtual void PreRender() override; void Fix_SilentPatch(); + RwFrame* GetTowBarFrame() const; static void (CAutomobile::*orgAutomobilePreRender)(); static float ms_engineCompSpeed;