diff options
author | Nikolay Korolev <nickvnuk@gmail.com> | 2019-10-12 22:19:54 +0300 |
---|---|---|
committer | Nikolay Korolev <nickvnuk@gmail.com> | 2019-10-12 22:19:54 +0300 |
commit | bd6ded198b5e89f97ece669082c46e95701991e5 (patch) | |
tree | 84de914159aa107f9f6cfe2d86137c5be657536d /src/control/CarCtrl.cpp | |
parent | a34870645a27c64234b3732dfc549f143ed5d954 (diff) |
fixes
Diffstat (limited to 'src/control/CarCtrl.cpp')
-rw-r--r-- | src/control/CarCtrl.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/control/CarCtrl.cpp b/src/control/CarCtrl.cpp index 5923642d..fd6d8057 100644 --- a/src/control/CarCtrl.cpp +++ b/src/control/CarCtrl.cpp @@ -1649,7 +1649,8 @@ void CCarCtrl::PickNextNodeToChaseCar(CVehicle* pVehicle, float targetX, float t int16 numNodes; float distanceToTargetNode; #ifndef REMOVE_TREADABLE_PATHFIND - if (pTarget && pTarget->m_pCurGroundEntity->m_type == ENTITY_TYPE_BUILDING && + if (pTarget && pTarget->m_pCurGroundEntity && + pTarget->m_pCurGroundEntity->m_type == ENTITY_TYPE_BUILDING && ((CBuilding*)pTarget->m_pCurGroundEntity)->GetIsATreadable() && ((CTreadable*)pTarget->m_pCurGroundEntity)->m_nodeIndices[0][0] >= 0){ CTreadable* pCurrentMapObject = (CTreadable*)pTarget->m_pCurGroundEntity; |