mirror of
https://github.com/GTAmodding/re3.git
synced 2025-10-13 23:30:32 +00:00
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:
parent
30061396e8
commit
835fa4e74b
4 changed files with 17 additions and 5 deletions
|
@ -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())){
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue