summaryrefslogtreecommitdiffstats
path: root/src/control
diff options
context:
space:
mode:
authoraap <aap@papnet.eu>2020-06-09 15:43:25 +0200
committerGitHub <noreply@github.com>2020-06-09 15:43:25 +0200
commitb07b1f0b519813c93a95b7baa2928c4d42c23af7 (patch)
tree552a3d776e1938d917901e7f2d46eb6db4af8f7a /src/control
parentMerge branch 'master' into miami (diff)
parentPeds, bike center of mass and reversing fixes (diff)
downloadre3-b07b1f0b519813c93a95b7baa2928c4d42c23af7.tar
re3-b07b1f0b519813c93a95b7baa2928c4d42c23af7.tar.gz
re3-b07b1f0b519813c93a95b7baa2928c4d42c23af7.tar.bz2
re3-b07b1f0b519813c93a95b7baa2928c4d42c23af7.tar.lz
re3-b07b1f0b519813c93a95b7baa2928c4d42c23af7.tar.xz
re3-b07b1f0b519813c93a95b7baa2928c4d42c23af7.tar.zst
re3-b07b1f0b519813c93a95b7baa2928c4d42c23af7.zip
Diffstat (limited to 'src/control')
-rw-r--r--src/control/CarAI.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/control/CarAI.cpp b/src/control/CarAI.cpp
index 121518f4..a5002ec5 100644
--- a/src/control/CarAI.cpp
+++ b/src/control/CarAI.cpp
@@ -183,7 +183,7 @@ void CCarAI::UpdateCarAI(CVehicle* pVehicle)
float distance = (pVehicle->AutoPilot.m_vecDestinationCoors - pVehicle->GetPosition()).Magnitude2D();
if ((pVehicle->bIsAmbulanceOnDuty || pVehicle->bIsFireTruckOnDuty) && distance < 20.0f)
pVehicle->AutoPilot.m_nCarMission = MISSION_EMERGENCYVEHICLE_STOP;
- if (distance < 5.0f){
+ if (distance < 3.0f){
pVehicle->AutoPilot.m_nCarMission = MISSION_NONE;
pVehicle->AutoPilot.m_nTempAction = TEMPACT_NONE;
if (pVehicle->bParking) {
@@ -236,8 +236,8 @@ void CCarAI::UpdateCarAI(CVehicle* pVehicle)
}
break;
case MISSION_GOTOCOORDS_ACCURATE:
- if ((pVehicle->AutoPilot.m_vecDestinationCoors - pVehicle->GetPosition()).Magnitude2D() < 20.0f ||
- pVehicle->AutoPilot.m_bIgnorePathfinding)
+ if ((pVehicle->AutoPilot.m_vecDestinationCoors - pVehicle->GetPosition()).Magnitude2D() < FindSwitchDistanceClose(pVehicle) ||
+ pVehicle->AutoPilot.m_bIgnorePathfinding)
pVehicle->AutoPilot.m_nCarMission = MISSION_GOTO_COORDS_STRAIGHT_ACCURATE;
break;
case MISSION_GOTO_COORDS_STRAIGHT_ACCURATE:
@@ -402,7 +402,7 @@ void CCarAI::UpdateCarAI(CVehicle* pVehicle)
if (flatSpeed < SQR(0.018f) && CTimer::GetTimeInMilliseconds() - pVehicle->AutoPilot.m_nAntiReverseTimer > 2000){
pVehicle->AutoPilot.m_nTempAction = TEMPACT_REVERSE;
if (pVehicle->AutoPilot.m_nCarMission != MISSION_NONE &&
- pVehicle->AutoPilot.m_nCarMission != MISSION_CRUISE || pVehicle->VehicleCreatedBy == RANDOM_VEHICLE)
+ pVehicle->AutoPilot.m_nCarMission != MISSION_CRUISE || pVehicle->VehicleCreatedBy == MISSION_VEHICLE)
pVehicle->AutoPilot.m_nTimeTempAction = CTimer::GetTimeInMilliseconds() + 1500;
else
pVehicle->AutoPilot.m_nTimeTempAction = CTimer::GetTimeInMilliseconds() + 750;
@@ -434,7 +434,7 @@ void CCarAI::UpdateCarAI(CVehicle* pVehicle)
pVehicle->AutoPilot.m_nCarMission = MISSION_BLOCKPLAYER_FARAWAY;
}
}
- if (pVehicle->GetUp().z < 0.7f){
+ if (pVehicle->GetUp().z < -0.7f){
pVehicle->AutoPilot.m_nTempAction = TEMPACT_WAIT;
pVehicle->AutoPilot.m_nTimeTempAction = CTimer::GetTimeInMilliseconds() + 1000;
}