SA: Disable the parachute animation fix in SA-MP if SA-MP Graphics Restore isn't installed

This commit is contained in:
Silent 2024-06-05 18:39:48 +02:00
parent fe53b68248
commit 1b7af04886
No known key found for this signature in database
GPG key ID: AE53149BB0C45AF1

View file

@ -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 );