File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed
Client/mods/deathmatch/logic Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -64,6 +64,11 @@ bool CVehicleUpgrades::IsUpgradeCompatible(unsigned short usUpgrade)
6464 return false ;
6565
6666 unsigned short usModel = m_pVehicle->GetModel ();
67+ auto * modelInfo = g_pGame->GetModelInfo (usModel);
68+
69+ if (modelInfo && modelInfo->GetParentID () != 0 )
70+ usModel = modelInfo->GetParentID ();
71+
6772 // Wheels should be compatible with any vehicle which have wheels, except
6873 // bike/bmx (they're buggy). Vortex is technically a car, but it has no
6974 // wheels.
@@ -361,8 +366,12 @@ bool CVehicleUpgrades::IsUpgradeCompatible(unsigned short usUpgrade)
361366 // Allow slot 2 to be upgraded regardless of ID and then check it has the required part
362367 if (GetSlotFromUpgrade (us, ucSlot) && (bReturn || ucSlot == 2 ))
363368 {
369+
364370 // Get our model supported upgrades
365- SVehicleSupportedUpgrades supportedUpgrades = m_pVehicle->GetModelInfo ()->GetVehicleSupportedUpgrades ();
371+ auto * info = g_pGame->GetModelInfo (usModel);
372+ modelInfo = info ? info : m_pVehicle->GetModelInfo ();
373+ SVehicleSupportedUpgrades supportedUpgrades = modelInfo->GetVehicleSupportedUpgrades ();
374+
366375 // Initialisation happens when we load the clump which is done when we require a specific model rather than in bulk
367376 if (supportedUpgrades.m_bInitialised == true )
368377 {
You can’t perform that action at this time.
0 commit comments