From f1d85b825bec81653910acf9a72bf3cbc38930a9 Mon Sep 17 00:00:00 2001 From: Silent Date: Mon, 28 Oct 2024 20:47:34 +0100 Subject: [PATCH] SA: Clean CVehicleModelInfo fields from ::Init so they are cleaned up after modloader loads the ASI Fixes #44 --- SilentPatchSA/SilentPatchSA.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/SilentPatchSA/SilentPatchSA.cpp b/SilentPatchSA/SilentPatchSA.cpp index d3ceae7..5a181ab 100644 --- a/SilentPatchSA/SilentPatchSA.cpp +++ b/SilentPatchSA/SilentPatchSA.cpp @@ -1167,10 +1167,10 @@ void DrawScriptSpritesAndRectangles( uint8_t arg ) bool ReadDoubleRearWheels(const wchar_t* pPath); bool __stdcall CheckDoubleRWheelsList( void* modelInfo, uint8_t* handlingData ); -CVehicleModelInfo* (__thiscall *orgVehicleModelInfoCtor)(CVehicleModelInfo*); -CVehicleModelInfo* __fastcall VehicleModelInfoCtor(CVehicleModelInfo* me) +CVehicleModelInfo* (__thiscall *orgVehicleModelInfoInit)(CVehicleModelInfo*); +CVehicleModelInfo* __fastcall VehicleModelInfoInit(CVehicleModelInfo* me) { - orgVehicleModelInfoCtor(me); + orgVehicleModelInfoInit(me); // Hack to satisfy some null checks static uintptr_t DUMMY; @@ -5604,9 +5604,7 @@ void Patch_SA_10(HINSTANCE hInstance) // Properly initialize all CVehicleModelInfo fields - ReadCall( 0x4C75E4, orgVehicleModelInfoCtor ); - InjectHook( 0x4C75E4, VehicleModelInfoCtor ); - + InterceptCall(0x4C7633, orgVehicleModelInfoInit, VehicleModelInfoInit); // Animated Phoenix hood scoop {