mirror of
https://gitlab.com/GaryOderNichts/re3-wiiu.git
synced 2024-11-23 17:49:16 +01: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
@ -65,7 +65,7 @@ cDMAudio::DestroyAllGameCreatedEntities(void)
|
|||||||
void
|
void
|
||||||
cDMAudio::SetOutputMode(bool8 surround)
|
cDMAudio::SetOutputMode(bool8 surround)
|
||||||
{
|
{
|
||||||
return AudioManager.SetOutputMode(surround);
|
AudioManager.SetOutputMode(surround);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -964,6 +964,7 @@ CCarCtrl::PossiblyRemoveVehicle(CVehicle* pVehicle)
|
|||||||
}
|
}
|
||||||
float distanceToPlayer = (pVehicle->GetPosition() - vecPlayerPos).Magnitude2D();
|
float distanceToPlayer = (pVehicle->GetPosition() - vecPlayerPos).Magnitude2D();
|
||||||
float threshold = OFFSCREEN_DESPAWN_RANGE;
|
float threshold = OFFSCREEN_DESPAWN_RANGE;
|
||||||
|
#ifndef EXTENDED_OFFSCREEN_DESPAWN_RANGE
|
||||||
if (pVehicle->GetIsOnScreen() ||
|
if (pVehicle->GetIsOnScreen() ||
|
||||||
TheCamera.Cams[TheCamera.ActiveCam].LookingLeft ||
|
TheCamera.Cams[TheCamera.ActiveCam].LookingLeft ||
|
||||||
TheCamera.Cams[TheCamera.ActiveCam].LookingRight ||
|
TheCamera.Cams[TheCamera.ActiveCam].LookingRight ||
|
||||||
@ -975,11 +976,15 @@ CCarCtrl::PossiblyRemoveVehicle(CVehicle* pVehicle)
|
|||||||
pVehicle->bIsLawEnforcer ||
|
pVehicle->bIsLawEnforcer ||
|
||||||
pVehicle->bIsCarParkVehicle ||
|
pVehicle->bIsCarParkVehicle ||
|
||||||
CTimer::GetTimeInMilliseconds() < pVehicle->m_nSetPieceExtendedRangeTime
|
CTimer::GetTimeInMilliseconds() < pVehicle->m_nSetPieceExtendedRangeTime
|
||||||
){
|
)
|
||||||
|
#endif
|
||||||
|
{
|
||||||
threshold = ONSCREEN_DESPAWN_RANGE * TheCamera.GenerationDistMultiplier;
|
threshold = ONSCREEN_DESPAWN_RANGE * TheCamera.GenerationDistMultiplier;
|
||||||
}
|
}
|
||||||
|
#ifndef EXTENDED_OFFSCREEN_DESPAWN_RANGE
|
||||||
if (TheCamera.GetForward().z < -0.9f)
|
if (TheCamera.GetForward().z < -0.9f)
|
||||||
threshold = 70.0f;
|
threshold = 70.0f;
|
||||||
|
#endif
|
||||||
if (pVehicle->bExtendedRange)
|
if (pVehicle->bExtendedRange)
|
||||||
threshold *= EXTENDED_RANGE_DESPAWN_MULTIPLIER;
|
threshold *= EXTENDED_RANGE_DESPAWN_MULTIPLIER;
|
||||||
if (distanceToPlayer > threshold && !CGarages::IsPointWithinHideOutGarage(pVehicle->GetPosition())){
|
if (distanceToPlayer > threshold && !CGarages::IsPointWithinHideOutGarage(pVehicle->GetPosition())){
|
||||||
|
@ -274,6 +274,9 @@ enum Config {
|
|||||||
|
|
||||||
#define NO_MOVIES // add option to disable intro videos
|
#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)
|
#if defined(__LP64__) || defined(_WIN64)
|
||||||
#define FIX_BUGS_64 // Must have fixes to be able to run 64 bit build
|
#define FIX_BUGS_64 // Must have fixes to be able to run 64 bit build
|
||||||
#endif
|
#endif
|
||||||
@ -449,6 +452,7 @@ static_assert(false, "SUPPORT_XBOX_SCRIPT and SUPPORT_MOBILE_SCRIPT are mutually
|
|||||||
#undef PS2_ALPHA_TEST
|
#undef PS2_ALPHA_TEST
|
||||||
#undef NO_ISLAND_LOADING
|
#undef NO_ISLAND_LOADING
|
||||||
#undef PS2_AUDIO_CHANNELS
|
#undef PS2_AUDIO_CHANNELS
|
||||||
|
#undef EXTENDED_OFFSCREEN_DESPAWN_RANGE
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// if these defines are enabled saves are not vanilla compatible without COMPATIBLE_SAVES
|
// if these defines are enabled saves are not vanilla compatible without COMPATIBLE_SAVES
|
||||||
|
@ -1105,8 +1105,9 @@ CPopulation::ManagePopulation(void)
|
|||||||
if (PedCreationDistMultiplier() * (PED_REMOVE_DIST_SPECIAL * TheCamera.GenerationDistMultiplier) < dist ||
|
if (PedCreationDistMultiplier() * (PED_REMOVE_DIST_SPECIAL * TheCamera.GenerationDistMultiplier) < dist ||
|
||||||
(!ped->bCullExtraFarAway && PedCreationDistMultiplier() * PED_REMOVE_DIST * TheCamera.GenerationDistMultiplier < dist)) {
|
(!ped->bCullExtraFarAway && PedCreationDistMultiplier() * PED_REMOVE_DIST * TheCamera.GenerationDistMultiplier < dist)) {
|
||||||
pedIsFarAway = true;
|
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 (CTimer::GetTimeInMilliseconds() > ped->m_nExtendedRangeTimer && !ped->GetIsOnScreen()) {
|
||||||
if (TheCamera.Cams[TheCamera.ActiveCam].Mode != CCam::MODE_SNIPER
|
if (TheCamera.Cams[TheCamera.ActiveCam].Mode != CCam::MODE_SNIPER
|
||||||
&& TheCamera.Cams[TheCamera.ActiveCam].Mode != CCam::MODE_SNIPER_RUNABOUT
|
&& 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;
|
ped->m_nExtendedRangeTimer = ped->m_nPedType == PEDTYPE_COP ? CTimer::GetTimeInMilliseconds() + 10000 : CTimer::GetTimeInMilliseconds() + 4000;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user