summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSergeanur <s.anureev@yandex.ua>2021-07-23 20:07:44 +0200
committerSergeanur <s.anureev@yandex.ua>2021-07-26 03:43:26 +0200
commitf73dfa12e6c41d1dcd16a4f5a220cc91c346ba7c (patch)
tree15f6a5a19e8c65fd0008ff0ff4d551f5cd6deeae /src
parentFix (diff)
downloadre3-f73dfa12e6c41d1dcd16a4f5a220cc91c346ba7c.tar
re3-f73dfa12e6c41d1dcd16a4f5a220cc91c346ba7c.tar.gz
re3-f73dfa12e6c41d1dcd16a4f5a220cc91c346ba7c.tar.bz2
re3-f73dfa12e6c41d1dcd16a4f5a220cc91c346ba7c.tar.lz
re3-f73dfa12e6c41d1dcd16a4f5a220cc91c346ba7c.tar.xz
re3-f73dfa12e6c41d1dcd16a4f5a220cc91c346ba7c.tar.zst
re3-f73dfa12e6c41d1dcd16a4f5a220cc91c346ba7c.zip
Diffstat (limited to 'src')
-rw-r--r--src/control/CarCtrl.cpp5
-rw-r--r--src/core/config.h4
-rw-r--r--src/peds/Population.cpp5
3 files changed, 12 insertions, 2 deletions
diff --git a/src/control/CarCtrl.cpp b/src/control/CarCtrl.cpp
index 35580053..37312b89 100644
--- a/src/control/CarCtrl.cpp
+++ b/src/control/CarCtrl.cpp
@@ -731,6 +731,7 @@ CCarCtrl::PossiblyRemoveVehicle(CVehicle* pVehicle)
}
float distanceToPlayer = (pVehicle->GetPosition() - vecPlayerPos).Magnitude2D();
float threshold = 50.0f;
+#ifndef EXTENDED_OFFSCREEN_DESPAWN_RANGE
if (pVehicle->GetIsOnScreen() ||
TheCamera.Cams[TheCamera.ActiveCam].LookingLeft ||
TheCamera.Cams[TheCamera.ActiveCam].LookingRight ||
@@ -741,7 +742,9 @@ CCarCtrl::PossiblyRemoveVehicle(CVehicle* pVehicle)
pVehicle->GetModelIndex() == MI_FIRETRUCK ||
pVehicle->bIsLawEnforcer ||
pVehicle->bIsCarParkVehicle
- ){
+ )
+#endif
+ {
threshold = 130.0f * TheCamera.GenerationDistMultiplier;
}
if (pVehicle->bExtendedRange)
diff --git a/src/core/config.h b/src/core/config.h
index f0960e44..17f0e44c 100644
--- a/src/core/config.h
+++ b/src/core/config.h
@@ -265,6 +265,9 @@ enum Config {
#define NO_MOVIES // add option to disable intro videos
+#define EXTENDED_OFFSCREEN_DESPAWN_RANGE // Use onscreen despawn range for offscreen peds and vehicles to avoid them despawning in the distance when you look
+ // away
+
#if defined(__LP64__) || defined(_WIN64)
#define FIX_BUGS_64 // Must have fixes to be able to run 64 bit build
#endif
@@ -450,6 +453,7 @@ enum Config {
#undef PS2_ALPHA_TEST
#undef NO_ISLAND_LOADING
#undef PS2_AUDIO_CHANNELS
+ #undef EXTENDED_OFFSCREEN_DESPAWN_RANGE
#define PC_PARTICLE
#define VC_PED_PORTS // To not process collisions always. But should be tested if that's really beneficial
#define VC_RAIN_NERF // Reduces number of rain particles
diff --git a/src/peds/Population.cpp b/src/peds/Population.cpp
index 1d2a5798..fcabff91 100644
--- a/src/peds/Population.cpp
+++ b/src/peds/Population.cpp
@@ -1126,13 +1126,16 @@ CPopulation::ManagePopulation(void)
bool pedIsFarAway = false;
if (PedCreationDistMultiplier() * (PED_REMOVE_DIST_SPECIAL * TheCamera.GenerationDistMultiplier) < dist
|| (!ped->bCullExtraFarAway && PedCreationDistMultiplier() * PED_REMOVE_DIST * TheCamera.GenerationDistMultiplier < dist)
+#ifndef EXTENDED_OFFSCREEN_DESPAWN_RANGE
|| (PedCreationDistMultiplier() * (MIN_CREATION_DIST + CREATION_RANGE) * OFFSCREEN_CREATION_MULT < dist
&& !ped->GetIsOnScreen()
&& TheCamera.Cams[TheCamera.ActiveCam].Mode != CCam::MODE_SNIPER
&& TheCamera.Cams[TheCamera.ActiveCam].Mode != CCam::MODE_SNIPER_RUNABOUT
&& !TheCamera.Cams[TheCamera.ActiveCam].LookingLeft
&& !TheCamera.Cams[TheCamera.ActiveCam].LookingRight
- && !TheCamera.Cams[TheCamera.ActiveCam].LookingBehind))
+ && !TheCamera.Cams[TheCamera.ActiveCam].LookingBehind)
+#endif
+ )
pedIsFarAway = true;
if (!pedIsFarAway)