summaryrefslogtreecommitdiff
path: root/src/control/CarCtrl.cpp
diff options
context:
space:
mode:
authorNikolay Korolev <nickvnuk@gmail.com>2019-10-12 22:19:54 +0300
committerNikolay Korolev <nickvnuk@gmail.com>2019-10-12 22:19:54 +0300
commitbd6ded198b5e89f97ece669082c46e95701991e5 (patch)
tree84de914159aa107f9f6cfe2d86137c5be657536d /src/control/CarCtrl.cpp
parenta34870645a27c64234b3732dfc549f143ed5d954 (diff)
fixes
Diffstat (limited to 'src/control/CarCtrl.cpp')
-rw-r--r--src/control/CarCtrl.cpp3
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;