summaryrefslogtreecommitdiffstats
path: root/src/control/CarCtrl.cpp
diff options
context:
space:
mode:
authorSergeanur <s.anureev@yandex.ua>2021-07-23 20:07:44 +0200
committerSergeanur <s.anureev@yandex.ua>2021-07-31 19:32:13 +0200
commit835fa4e74b1014ca1ccef83979f039cafb75e3a4 (patch)
tree510307535d59673ac5aea45b8ac834bf53489f67 /src/control/CarCtrl.cpp
parentCVisibilityPlugins and CRenderer fixes; pulled MLO back in (diff)
downloadre3-835fa4e74b1014ca1ccef83979f039cafb75e3a4.tar
re3-835fa4e74b1014ca1ccef83979f039cafb75e3a4.tar.gz
re3-835fa4e74b1014ca1ccef83979f039cafb75e3a4.tar.bz2
re3-835fa4e74b1014ca1ccef83979f039cafb75e3a4.tar.lz
re3-835fa4e74b1014ca1ccef83979f039cafb75e3a4.tar.xz
re3-835fa4e74b1014ca1ccef83979f039cafb75e3a4.tar.zst
re3-835fa4e74b1014ca1ccef83979f039cafb75e3a4.zip
Diffstat (limited to 'src/control/CarCtrl.cpp')
-rw-r--r--src/control/CarCtrl.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/control/CarCtrl.cpp b/src/control/CarCtrl.cpp
index 5e4e62ee..870669e8 100644
--- a/src/control/CarCtrl.cpp
+++ b/src/control/CarCtrl.cpp
@@ -964,6 +964,7 @@ CCarCtrl::PossiblyRemoveVehicle(CVehicle* pVehicle)
}
float distanceToPlayer = (pVehicle->GetPosition() - vecPlayerPos).Magnitude2D();
float threshold = OFFSCREEN_DESPAWN_RANGE;
+#ifndef EXTENDED_OFFSCREEN_DESPAWN_RANGE
if (pVehicle->GetIsOnScreen() ||
TheCamera.Cams[TheCamera.ActiveCam].LookingLeft ||
TheCamera.Cams[TheCamera.ActiveCam].LookingRight ||
@@ -975,11 +976,15 @@ CCarCtrl::PossiblyRemoveVehicle(CVehicle* pVehicle)
pVehicle->bIsLawEnforcer ||
pVehicle->bIsCarParkVehicle ||
CTimer::GetTimeInMilliseconds() < pVehicle->m_nSetPieceExtendedRangeTime
- ){
+ )
+#endif
+ {
threshold = ONSCREEN_DESPAWN_RANGE * TheCamera.GenerationDistMultiplier;
}
+#ifndef EXTENDED_OFFSCREEN_DESPAWN_RANGE
if (TheCamera.GetForward().z < -0.9f)
threshold = 70.0f;
+#endif
if (pVehicle->bExtendedRange)
threshold *= EXTENDED_RANGE_DESPAWN_MULTIPLIER;
if (distanceToPlayer > threshold && !CGarages::IsPointWithinHideOutGarage(pVehicle->GetPosition())){