small refactoring

This commit is contained in:
Nikolay Korolev 2021-08-20 17:49:51 +03:00
parent 239367663b
commit 11f2d941f1

View file

@ -1012,11 +1012,12 @@ CCarCtrl::PossiblyRemoveVehicle(CVehicle* pVehicle)
delete pVehicle; delete pVehicle;
return; return;
} }
if (pVehicle->GetStatus() != STATUS_WRECKED || pVehicle->m_nTimeOfDeath == 0) if (pVehicle->GetStatus() == STATUS_WRECKED) {
return; if (pVehicle->m_nTimeOfDeath != 0) {
if (CTimer::GetTimeInMilliseconds() > pVehicle->m_nTimeOfDeath + 60000 && if (CTimer::GetTimeInMilliseconds() > pVehicle->m_nTimeOfDeath + 60000 &&
!pVehicle->GetIsOnScreen()){ CTimer::GetTimeInMilliseconds() > pVehicle->m_nSetPieceExtendedRangeTime &&
if ((pVehicle->GetPosition() - vecPlayerPos).MagnitudeSqr() > SQR(7.5f)){ !(pVehicle->GetIsOnScreen())) {
if ((pVehicle->GetPosition() - vecPlayerPos).MagnitudeSqr() > SQR(6.5f)) {
if (!CGarages::IsPointWithinHideOutGarage(pVehicle->GetPosition())) { if (!CGarages::IsPointWithinHideOutGarage(pVehicle->GetPosition())) {
CWorld::Remove(pVehicle); CWorld::Remove(pVehicle);
delete pVehicle; delete pVehicle;
@ -1024,6 +1025,8 @@ CCarCtrl::PossiblyRemoveVehicle(CVehicle* pVehicle)
} }
} }
} }
}
}
int32 int32
CCarCtrl::CountCarsOfType(int32 mi) CCarCtrl::CountCarsOfType(int32 mi)