File tree Expand file tree Collapse file tree 4 files changed +12
-1
lines changed Expand file tree Collapse file tree 4 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -488,6 +488,15 @@ bool CModelInfoSA::DoIsLoaded()
488488 return bLoaded;
489489}
490490
491+ bool CModelInfoSA::IsCollisionLoaded ()
492+ {
493+ m_pInterface = ppModelInfo[m_dwModelID];
494+ if (!m_pInterface || !m_pInterface->pColModel )
495+ return false ;
496+
497+ return m_pInterface->pColModel ->m_data != nullptr ;
498+ }
499+
491500unsigned short CModelInfoSA::GetFlags ()
492501{
493502 return ppModelInfo[m_dwModelID]->usFlags ;
Original file line number Diff line number Diff line change @@ -389,6 +389,7 @@ class CModelInfoSA : public CModelInfo
389389 void Remove ();
390390 bool UnloadUnused ();
391391 bool IsLoaded ();
392+ bool IsCollisionLoaded () override ;
392393 bool DoIsLoaded ();
393394 unsigned short GetFlags ();
394395 unsigned short GetOriginalFlags ();
Original file line number Diff line number Diff line change @@ -4306,7 +4306,7 @@ void CClientVehicle::ApplyHandling()
43064306 return ;
43074307
43084308 // Ensure collision model is loaded before recalculating (needed for suspension lines)
4309- if (!pModelInfo->GetInterface ()-> pColModel || !pModelInfo-> GetInterface ()-> pColModel -> m_data )
4309+ if (!pModelInfo->IsCollisionLoaded () )
43104310 return ;
43114311
43124312 m_pVehicle->RecalculateHandling ();
Original file line number Diff line number Diff line change @@ -162,6 +162,7 @@ class CModelInfo
162162 virtual BYTE GetVehicleType () const noexcept = 0;
163163 virtual void Request (EModelRequestType requestType, const char * szTag /* = NULL*/ ) = 0;
164164 virtual bool IsLoaded () = 0;
165+ virtual bool IsCollisionLoaded () = 0;
165166 virtual unsigned short GetFlags () = 0;
166167 virtual unsigned short GetOriginalFlags () = 0;
167168 virtual void SetFlags (unsigned short usFlags) = 0;
You can’t perform that action at this time.
0 commit comments