summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorNikolay Korolev <nickvnuk@gmail.com>2019-10-12 22:23:37 +0300
committerGitHub <noreply@github.com>2019-10-12 22:23:37 +0300
commit225ad5d78ebff032640d319f4757cc0ef9e03b24 (patch)
tree398f3fbc01a291239c5cc55c321ae00c1cfbd3d0 /src
parent1fed8e9482d18aaea0a11999b493996b0b28a2f3 (diff)
parentbd6ded198b5e89f97ece669082c46e95701991e5 (diff)
Merge pull request #237 from Nick007J/master
fixes
Diffstat (limited to 'src')
-rw-r--r--src/control/CarCtrl.cpp3
-rw-r--r--src/control/Script.cpp6
2 files changed, 5 insertions, 4 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;
diff --git a/src/control/Script.cpp b/src/control/Script.cpp
index db4ef82f..5885b310 100644
--- a/src/control/Script.cpp
+++ b/src/control/Script.cpp
@@ -1988,7 +1988,7 @@ int8 CRunningScript::ProcessCommandsFrom100To199(int32 command)
car->m_status = STATUS_PHYSICS;
car->bEngineOn = true;
car->AutoPilot.m_nCruiseSpeed = max(car->AutoPilot.m_nCruiseSpeed, 6);
- car->AutoPilot.m_nTimeToStartMission = CTimer::GetTimeInMilliseconds();
+ car->AutoPilot.m_nAntiReverseTimer = CTimer::GetTimeInMilliseconds();
return 0;
}
case COMMAND_CAR_WANDER_RANDOMLY:
@@ -2000,7 +2000,7 @@ int8 CRunningScript::ProcessCommandsFrom100To199(int32 command)
car->AutoPilot.m_nCarMission = MISSION_CRUISE;
car->bEngineOn = true;
car->AutoPilot.m_nCruiseSpeed = max(car->AutoPilot.m_nCruiseSpeed, 6);
- car->AutoPilot.m_nTimeToStartMission = CTimer::GetTimeInMilliseconds();
+ car->AutoPilot.m_nAntiReverseTimer = CTimer::GetTimeInMilliseconds();
return 0;
}
case COMMAND_CAR_SET_IDLE:
@@ -2100,7 +2100,7 @@ int8 CRunningScript::ProcessCommandsFrom100To199(int32 command)
CVehicle* car = CPools::GetVehiclePool()->GetAt(ScriptParams[0]);
assert(car);
car->AutoPilot.m_nCarMission = (eCarMission)ScriptParams[1];
- car->AutoPilot.m_nTimeToStartMission = CTimer::GetTimeInMilliseconds();
+ car->AutoPilot.m_nAntiReverseTimer = CTimer::GetTimeInMilliseconds();
car->bEngineOn = true;
return 0;
}