diff options
author | Nikolay Korolev <nickvnuk@gmail.com> | 2019-10-12 21:19:54 +0200 |
---|---|---|
committer | Nikolay Korolev <nickvnuk@gmail.com> | 2019-10-12 21:19:54 +0200 |
commit | bd6ded198b5e89f97ece669082c46e95701991e5 (patch) | |
tree | 84de914159aa107f9f6cfe2d86137c5be657536d /src/control/CarCtrl.cpp | |
parent | blunder (diff) | |
download | re3-bd6ded198b5e89f97ece669082c46e95701991e5.tar re3-bd6ded198b5e89f97ece669082c46e95701991e5.tar.gz re3-bd6ded198b5e89f97ece669082c46e95701991e5.tar.bz2 re3-bd6ded198b5e89f97ece669082c46e95701991e5.tar.lz re3-bd6ded198b5e89f97ece669082c46e95701991e5.tar.xz re3-bd6ded198b5e89f97ece669082c46e95701991e5.tar.zst re3-bd6ded198b5e89f97ece669082c46e95701991e5.zip |
Diffstat (limited to '')
-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; |