diff options
author | Nikolay Korolev <nickvnuk@gmail.com> | 2019-10-12 21:24:58 +0200 |
---|---|---|
committer | Nikolay Korolev <nickvnuk@gmail.com> | 2019-10-12 21:24:58 +0200 |
commit | a1700eeaa429e84ac95637652fed2d5719118c6e (patch) | |
tree | 37b3028b5d30e0425a957662fed24bad1ff8ab40 /src/control/CarCtrl.cpp | |
parent | script 400-499 start (diff) | |
parent | Merge pull request #237 from Nick007J/master (diff) | |
download | re3-a1700eeaa429e84ac95637652fed2d5719118c6e.tar re3-a1700eeaa429e84ac95637652fed2d5719118c6e.tar.gz re3-a1700eeaa429e84ac95637652fed2d5719118c6e.tar.bz2 re3-a1700eeaa429e84ac95637652fed2d5719118c6e.tar.lz re3-a1700eeaa429e84ac95637652fed2d5719118c6e.tar.xz re3-a1700eeaa429e84ac95637652fed2d5719118c6e.tar.zst re3-a1700eeaa429e84ac95637652fed2d5719118c6e.zip |
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; |