From 1b7af0488636d9fd3ffb8171e097728fbaf7afe2 Mon Sep 17 00:00:00 2001 From: Silent Date: Wed, 5 Jun 2024 18:39:48 +0200 Subject: [PATCH] SA: Disable the parachute animation fix in SA-MP if SA-MP Graphics Restore isn't installed --- SilentPatchSA/SilentPatchSA.cpp | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/SilentPatchSA/SilentPatchSA.cpp b/SilentPatchSA/SilentPatchSA.cpp index f0431a5..d7e7528 100644 --- a/SilentPatchSA/SilentPatchSA.cpp +++ b/SilentPatchSA/SilentPatchSA.cpp @@ -3490,6 +3490,7 @@ BOOL InjectDelayedPatches_10() const bool bSAMP = moduleList.Get(L"samp") != nullptr; const bool bSARender = moduleList.Get(L"SARender") != nullptr; const bool bOutfit = moduleList.Get(L"outfit") != nullptr; + const bool bSAMPGraphicsRestore = moduleList.Get(L"SAMPGraphicRestore") != nullptr; if ( bSAMP ) { @@ -3907,6 +3908,17 @@ BOOL InjectDelayedPatches_10() SVF::RegisterGetModelInfoCB(func); } + + // Disable building pipeline for skinned objects (like parachute) + // SAMP Graphics Restore fixes the bug preventing this fix from working right + if (!bSAMP || bSAMPGraphicsRestore) + { + using namespace SkinBuildingPipelineFix; + + InterceptCall(0x5D7F1E, orgCustomBuildingDNPipeline_CustomPipeAtomicSetup, CustomBuildingDNPipeline_CustomPipeAtomicSetup_Skinned); + } + + #ifndef NDEBUG if ( const int QPCDays = GetPrivateProfileIntW(L"Debug", L"AddDaysToQPC", 0, wcModulePath); QPCDays != 0 ) { @@ -5074,14 +5086,6 @@ void Patch_SA_10(HINSTANCE hInstance) } - // Disable building pipeline for skinned objects (like parachute) - { - using namespace SkinBuildingPipelineFix; - - InterceptCall(0x5D7F1E, orgCustomBuildingDNPipeline_CustomPipeAtomicSetup, CustomBuildingDNPipeline_CustomPipeAtomicSetup_Skinned); - } - - // Reset requested extras if created vehicle has no extras // Fixes eg. lightless taxis InjectHook( 0x4C97B1, CVehicleModelInfo::ResetCompsForNoExtras, HookType::Call );