Make cars and peds to not despawn when you look away

# Conflicts:
#	src/control/CarCtrl.cpp
#	src/core/config.h
#	src/peds/Population.cpp
This commit is contained in:
Sergeanur
2021-07-23 21:07:44 +03:00
parent 30061396e8
commit 835fa4e74b
4 changed files with 17 additions and 5 deletions

View File

@ -1105,8 +1105,9 @@ CPopulation::ManagePopulation(void)
if (PedCreationDistMultiplier() * (PED_REMOVE_DIST_SPECIAL * TheCamera.GenerationDistMultiplier) < dist ||
(!ped->bCullExtraFarAway && PedCreationDistMultiplier() * PED_REMOVE_DIST * TheCamera.GenerationDistMultiplier < dist)) {
pedIsFarAway = true;
} else if (PedCreationDistMultiplier() * (MIN_CREATION_DIST + CREATION_RANGE) * OFFSCREEN_CREATION_MULT < dist) {
}
#ifndef EXTENDED_OFFSCREEN_DESPAWN_RANGE
else if (PedCreationDistMultiplier() * (MIN_CREATION_DIST + CREATION_RANGE) * OFFSCREEN_CREATION_MULT < dist) {
if (CTimer::GetTimeInMilliseconds() > ped->m_nExtendedRangeTimer && !ped->GetIsOnScreen()) {
if (TheCamera.Cams[TheCamera.ActiveCam].Mode != CCam::MODE_SNIPER
&& TheCamera.Cams[TheCamera.ActiveCam].Mode != CCam::MODE_SNIPER_RUNABOUT
@ -1118,7 +1119,9 @@ CPopulation::ManagePopulation(void)
}
}
} else {
}
#endif
else {
ped->m_nExtendedRangeTimer = ped->m_nPedType == PEDTYPE_COP ? CTimer::GetTimeInMilliseconds() + 10000 : CTimer::GetTimeInMilliseconds() + 4000;
}