small refactoring

This commit is contained in:
Nikolay Korolev 2021-08-20 17:49:51 +03:00
parent ef0b5f857d
commit aa104bb0aa
1 changed files with 10 additions and 8 deletions

View File

@ -773,14 +773,16 @@ CCarCtrl::PossiblyRemoveVehicle(CVehicle* pVehicle)
delete pVehicle;
return;
}
if (pVehicle->GetStatus() != STATUS_WRECKED || pVehicle->m_nTimeOfDeath == 0)
return;
if (CTimer::GetTimeInMilliseconds() > pVehicle->m_nTimeOfDeath + 60000 &&
!(pVehicle->GetIsOnScreen() && CRenderer::IsEntityCullZoneVisible(pVehicle)) ){
if ((pVehicle->GetPosition() - vecPlayerPos).MagnitudeSqr() > SQR(7.5f)){
if (!CGarages::IsPointWithinHideOutGarage(pVehicle->GetPosition())){
CWorld::Remove(pVehicle);
delete pVehicle;
if (pVehicle->GetStatus() == STATUS_WRECKED) {
if (pVehicle->m_nTimeOfDeath != 0) {
if (CTimer::GetTimeInMilliseconds() > pVehicle->m_nTimeOfDeath + 60000 &&
!(pVehicle->GetIsOnScreen() && CRenderer::IsEntityCullZoneVisible(pVehicle))) {
if ((pVehicle->GetPosition() - vecPlayerPos).MagnitudeSqr() > SQR(7.5f)) {
if (!CGarages::IsPointWithinHideOutGarage(pVehicle->GetPosition())) {
CWorld::Remove(pVehicle);
delete pVehicle;
}
}
}
}
}