summaryrefslogtreecommitdiffstats
path: root/src/control
diff options
context:
space:
mode:
authorSergeanur <s.anureev@yandex.ua>2021-07-31 19:43:52 +0200
committerSergeanur <s.anureev@yandex.ua>2021-07-31 19:43:52 +0200
commita481b900b948f5e9c40e334b789f663f7d6d5932 (patch)
tree28484bf4bcc267a941b7746fafbce7c57938eb18 /src/control
parentMerge pull request #1259 from aap/lcs (diff)
parentAllow sector ped count to exceed gap-list size (diff)
downloadre3-a481b900b948f5e9c40e334b789f663f7d6d5932.tar
re3-a481b900b948f5e9c40e334b789f663f7d6d5932.tar.gz
re3-a481b900b948f5e9c40e334b789f663f7d6d5932.tar.bz2
re3-a481b900b948f5e9c40e334b789f663f7d6d5932.tar.lz
re3-a481b900b948f5e9c40e334b789f663f7d6d5932.tar.xz
re3-a481b900b948f5e9c40e334b789f663f7d6d5932.tar.zst
re3-a481b900b948f5e9c40e334b789f663f7d6d5932.zip
Diffstat (limited to 'src/control')
-rw-r--r--src/control/CarCtrl.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/control/CarCtrl.cpp b/src/control/CarCtrl.cpp
index f50111ec..93fde4eb 100644
--- a/src/control/CarCtrl.cpp
+++ b/src/control/CarCtrl.cpp
@@ -983,9 +983,12 @@ CCarCtrl::PossiblyRemoveVehicle(CVehicle* pVehicle)
}
float distanceToPlayer = (pVehicle->GetPosition() - vecPlayerPos).Magnitude2D();
float despawnMultiplier = 1.0f;
+#ifndef EXTENDED_OFFSCREEN_DESPAWN_RANGE
if (FindPlayerVehicle() && TheCamera.Cams[TheCamera.ActiveCam].Mode == CCam::MODE_1STPERSON && !FrontEndMenuManager.m_PrefsUseWideScreen)
despawnMultiplier = 0.75f;
+#endif
float threshold = OFFSCREEN_DESPAWN_RANGE * despawnMultiplier;
+#ifndef EXTENDED_OFFSCREEN_DESPAWN_RANGE
if (pVehicle->GetIsOnScreen() ||
TheCamera.Cams[TheCamera.ActiveCam].LookingLeft ||
TheCamera.Cams[TheCamera.ActiveCam].LookingRight ||
@@ -997,11 +1000,15 @@ CCarCtrl::PossiblyRemoveVehicle(CVehicle* pVehicle)
pVehicle->bIsLawEnforcer ||
pVehicle->bIsCarParkVehicle ||
CTimer::GetTimeInMilliseconds() < pVehicle->m_nSetPieceExtendedRangeTime
- ){
+ )
+#endif
+ {
threshold = ONSCREEN_DESPAWN_RANGE * despawnMultiplier * 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())){