summaryrefslogtreecommitdiffstats
path: root/src/control
diff options
context:
space:
mode:
authoreray orçunus <erayorcunus@gmail.com>2020-06-08 23:56:01 +0200
committereray orçunus <erayorcunus@gmail.com>2020-06-09 00:29:55 +0200
commitdba2b052a64bc4f468e94fbf078eff7a0cb27ae4 (patch)
tree7cb2889a80594fb9a26184846475dbbdaf90306f /src/control
parentbla (diff)
downloadre3-dba2b052a64bc4f468e94fbf078eff7a0cb27ae4.tar
re3-dba2b052a64bc4f468e94fbf078eff7a0cb27ae4.tar.gz
re3-dba2b052a64bc4f468e94fbf078eff7a0cb27ae4.tar.bz2
re3-dba2b052a64bc4f468e94fbf078eff7a0cb27ae4.tar.lz
re3-dba2b052a64bc4f468e94fbf078eff7a0cb27ae4.tar.xz
re3-dba2b052a64bc4f468e94fbf078eff7a0cb27ae4.tar.zst
re3-dba2b052a64bc4f468e94fbf078eff7a0cb27ae4.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;
}