Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files
Make cars and peds to not despawn when you look away
  • Loading branch information
Sergeanur committed Jul 23, 2021
1 parent 3adf37a commit 3e2f90db8b20c7c4ee4b392e3cb422bf974ed81c
Showing with 8 additions and 1 deletion.
  1. +5 −1 src/control/CarCtrl.cpp
  2. +3 −0 src/peds/Population.cpp
@@ -731,7 +731,11 @@ CCarCtrl::PossiblyRemoveVehicle(CVehicle* pVehicle)
}
float distanceToPlayer = (pVehicle->GetPosition() - vecPlayerPos).Magnitude2D();
float threshold = 50.0f;
if (pVehicle->GetIsOnScreen() ||
if (
#if defined(FREE_CAM) && !defined(SQUEEZE_PERFORAMNCE)
CCamera::bFreeCam ||
#endif
pVehicle->GetIsOnScreen() ||
TheCamera.Cams[TheCamera.ActiveCam].LookingLeft ||
TheCamera.Cams[TheCamera.ActiveCam].LookingRight ||
TheCamera.Cams[TheCamera.ActiveCam].LookingBehind ||
@@ -1127,6 +1127,9 @@ CPopulation::ManagePopulation(void)
if (PedCreationDistMultiplier() * (PED_REMOVE_DIST_SPECIAL * TheCamera.GenerationDistMultiplier) < dist
|| (!ped->bCullExtraFarAway && PedCreationDistMultiplier() * PED_REMOVE_DIST * TheCamera.GenerationDistMultiplier < dist)
|| (PedCreationDistMultiplier() * (MIN_CREATION_DIST + CREATION_RANGE) * OFFSCREEN_CREATION_MULT < dist
#if defined(FREE_CAM) && !defined(SQUEEZE_PERFORAMNCE)
&& !CCamera::bFreeCam
#endif
&& !ped->GetIsOnScreen()
&& TheCamera.Cams[TheCamera.ActiveCam].Mode != CCam::MODE_SNIPER
&& TheCamera.Cams[TheCamera.ActiveCam].Mode != CCam::MODE_SNIPER_RUNABOUT

0 comments on commit 3e2f90d

Please sign in to comment.