@@ -9015,6 +9015,10 @@ bool CStaticFunctionDefinitions::SetVehicleHandling(CClientVehicle* pVehicle, Ha
90159015 {
90169016 if (SetEntryHandling (pEntry, eProperty, ucValue))
90179017 {
9018+ CModelInfo* pModelInfo = g_pGame->GetModelInfo (pVehicle->GetModel ());
9019+ if (!pModelInfo || !pModelInfo->IsLoaded ())
9020+ return false ;
9021+
90189022 pVehicle->ApplyHandling ();
90199023 return true ;
90209024 }
@@ -9032,6 +9036,10 @@ bool CStaticFunctionDefinitions::SetVehicleHandling(CClientVehicle* pVehicle, Ha
90329036 {
90339037 if (SetEntryHandling (pEntry, eProperty, uiValue))
90349038 {
9039+ CModelInfo* pModelInfo = g_pGame->GetModelInfo (pVehicle->GetModel ());
9040+ if (!pModelInfo || !pModelInfo->IsLoaded ())
9041+ return false ;
9042+
90359043 pVehicle->ApplyHandling ();
90369044 return true ;
90379045 }
@@ -9049,6 +9057,10 @@ bool CStaticFunctionDefinitions::SetVehicleHandling(CClientVehicle* pVehicle, Ha
90499057 {
90509058 if (SetEntryHandling (pEntry, eProperty, fValue ))
90519059 {
9060+ CModelInfo* pModelInfo = g_pGame->GetModelInfo (pVehicle->GetModel ());
9061+ if (!pModelInfo || !pModelInfo->IsLoaded ())
9062+ return false ;
9063+
90529064 pVehicle->ApplyHandling ();
90539065 return true ;
90549066 }
@@ -9066,6 +9078,10 @@ bool CStaticFunctionDefinitions::SetVehicleHandling(CClientVehicle* pVehicle, Ha
90669078 {
90679079 if (SetEntryHandling (pEntry, eProperty, strValue))
90689080 {
9081+ CModelInfo* pModelInfo = g_pGame->GetModelInfo (pVehicle->GetModel ());
9082+ if (!pModelInfo || !pModelInfo->IsLoaded ())
9083+ return false ;
9084+
90699085 pVehicle->ApplyHandling ();
90709086 return true ;
90719087 }
@@ -9083,6 +9099,10 @@ bool CStaticFunctionDefinitions::SetVehicleHandling(CClientVehicle* pVehicle, Ha
90839099 {
90849100 if (SetEntryHandling (pEntry, eProperty, vecValue))
90859101 {
9102+ CModelInfo* pModelInfo = g_pGame->GetModelInfo (pVehicle->GetModel ());
9103+ if (!pModelInfo || !pModelInfo->IsLoaded ())
9104+ return false ;
9105+
90869106 pVehicle->ApplyHandling ();
90879107 return true ;
90889108 }
@@ -9141,6 +9161,10 @@ bool CStaticFunctionDefinitions::ResetVehicleHandling(CClientVehicle* pVehicle)
91419161 pEntry->SetSuspensionUpperLimit (pEntry->GetSuspensionLowerLimit () - 0 .1f );
91429162 }
91439163
9164+ CModelInfo* pModelInfo = g_pGame->GetModelInfo (pVehicle->GetModel ());
9165+ if (!pModelInfo || !pModelInfo->IsLoaded ())
9166+ return false ;
9167+
91449168 pVehicle->ApplyHandling ();
91459169
91469170 return true ;
@@ -9190,6 +9214,10 @@ bool CStaticFunctionDefinitions::ResetVehicleHandlingProperty(CClientVehicle* pV
91909214 return false ;
91919215 }
91929216
9217+ CModelInfo* pModelInfo = g_pGame->GetModelInfo (pVehicle->GetModel ());
9218+ if (!pModelInfo || !pModelInfo->IsLoaded ())
9219+ return false ;
9220+
91939221 pVehicle->ApplyHandling ();
91949222
91959223 return true ;
0 commit comments