summaryrefslogtreecommitdiffstats
path: root/src/control/CarCtrl.cpp
diff options
context:
space:
mode:
authorNikolay Korolev <nickvnuk@gmail.com>2019-10-06 13:26:50 +0200
committerNikolay Korolev <nickvnuk@gmail.com>2019-10-06 13:26:50 +0200
commite10f5ee6a3f94a5ff2559f868c884e47d4628271 (patch)
tree3b2a2ceafc26e4215b49bf56e75cf80568251f26 /src/control/CarCtrl.cpp
parentcar AI (diff)
parentFixed player blip heading when looking left/right/behind (diff)
downloadre3-e10f5ee6a3f94a5ff2559f868c884e47d4628271.tar
re3-e10f5ee6a3f94a5ff2559f868c884e47d4628271.tar.gz
re3-e10f5ee6a3f94a5ff2559f868c884e47d4628271.tar.bz2
re3-e10f5ee6a3f94a5ff2559f868c884e47d4628271.tar.lz
re3-e10f5ee6a3f94a5ff2559f868c884e47d4628271.tar.xz
re3-e10f5ee6a3f94a5ff2559f868c884e47d4628271.tar.zst
re3-e10f5ee6a3f94a5ff2559f868c884e47d4628271.zip
Diffstat (limited to 'src/control/CarCtrl.cpp')
-rw-r--r--src/control/CarCtrl.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/control/CarCtrl.cpp b/src/control/CarCtrl.cpp
index a6cbad5e..4775d595 100644
--- a/src/control/CarCtrl.cpp
+++ b/src/control/CarCtrl.cpp
@@ -696,7 +696,7 @@ CCarCtrl::PossiblyRemoveVehicle(CVehicle* pVehicle)
}
if (pVehicle->bExtendedRange)
threshold *= 1.5f;
- if (distanceToPlayer > threshold && !CGarages::IsPointWithinHideOutGarage(&pVehicle->GetPosition())){
+ if (distanceToPlayer > threshold && !CGarages::IsPointWithinHideOutGarage(pVehicle->GetPosition())){
if (pVehicle->GetIsOnScreen() && CRenderer::IsEntityCullZoneVisible(pVehicle)){
pVehicle->bFadeOut = true;
}else{
@@ -712,9 +712,10 @@ CCarCtrl::PossiblyRemoveVehicle(CVehicle* pVehicle)
(pVehicle->GetPosition() - vecPlayerPos).Magnitude2D() > 25.0f &&
!IsThisVehicleInteresting(pVehicle) &&
!pVehicle->bIsLocked &&
+ pVehicle->CanBeDeleted() &&
!CTrafficLights::ShouldCarStopForLight(pVehicle, true) &&
!CTrafficLights::ShouldCarStopForBridge(pVehicle) &&
- !CGarages::IsPointWithinHideOutGarage(&pVehicle->GetPosition())){
+ !CGarages::IsPointWithinHideOutGarage(pVehicle->GetPosition())){
CWorld::Remove(pVehicle);
delete pVehicle;
return;
@@ -724,7 +725,7 @@ CCarCtrl::PossiblyRemoveVehicle(CVehicle* pVehicle)
if (CTimer::GetTimeInMilliseconds() > pVehicle->m_nTimeOfDeath + 60000 &&
(!pVehicle->GetIsOnScreen() || !CRenderer::IsEntityCullZoneVisible(pVehicle))){
if ((pVehicle->GetPosition() - vecPlayerPos).MagnitudeSqr() > SQR(7.5f)){
- if (!CGarages::IsPointWithinHideOutGarage(&pVehicle->GetPosition())){
+ if (!CGarages::IsPointWithinHideOutGarage(pVehicle->GetPosition())){
CWorld::Remove(pVehicle);
delete pVehicle;
}
@@ -1322,7 +1323,7 @@ void CCarCtrl::WeaveThroughPedsSectorList(CPtrList& lst, CVehicle* pVehicle, CPh
continue;
if (pPed->GetPosition().y < y_inf || pPed->GetPosition().y > y_sup)
continue;
- if (Abs(pPed->GetPosition().z - pPed->GetPosition().z) >= PED_HEIGHT_DIFF_TO_CONSIDER_WEAVING)
+ if (Abs(pPed->GetPosition().z - pVehicle->GetPosition().z) >= PED_HEIGHT_DIFF_TO_CONSIDER_WEAVING)
continue;
if (pPed->m_pCurSurface != pVehicle)
WeaveForPed(pPed, pVehicle, pAngleToWeaveLeft, pAngleToWeaveRight);