diff options
author | eray orçunus <erayorcunus@gmail.com> | 2019-09-16 19:32:58 +0200 |
---|---|---|
committer | eray orçunus <erayorcunus@gmail.com> | 2019-09-17 22:22:34 +0200 |
commit | 0f9178568b3470d35ffc1d5e21a230d8cc11eef1 (patch) | |
tree | e6b421513dfac9908ae727290ab7ec947842cdf3 /src/control | |
parent | Merge pull request #208 from Nick007J/master (diff) | |
download | re3-0f9178568b3470d35ffc1d5e21a230d8cc11eef1.tar re3-0f9178568b3470d35ffc1d5e21a230d8cc11eef1.tar.gz re3-0f9178568b3470d35ffc1d5e21a230d8cc11eef1.tar.bz2 re3-0f9178568b3470d35ffc1d5e21a230d8cc11eef1.tar.lz re3-0f9178568b3470d35ffc1d5e21a230d8cc11eef1.tar.xz re3-0f9178568b3470d35ffc1d5e21a230d8cc11eef1.tar.zst re3-0f9178568b3470d35ffc1d5e21a230d8cc11eef1.zip |
Diffstat (limited to '')
-rw-r--r-- | src/control/CarCtrl.cpp | 7 | ||||
-rw-r--r-- | src/control/Garages.cpp | 3 | ||||
-rw-r--r-- | src/control/Garages.h | 3 |
3 files changed, 8 insertions, 5 deletions
diff --git a/src/control/CarCtrl.cpp b/src/control/CarCtrl.cpp index cae010d2..0be8a0a0 100644 --- a/src/control/CarCtrl.cpp +++ b/src/control/CarCtrl.cpp @@ -696,7 +696,7 @@ CCarCtrl::PossiblyRemoveVehicle(CVehicle* pVehicle) } if (pVehicle->bExtendedRange) threshold *= 1.5f; - if (distanceToPlayer > threshold && !CGarages::IsPointWithinHideOutGarage(&pVehicle->GetPosition())){ + if (distanceToPlayer > threshold && !CGarages::IsPointWithinHideOutGarage(pVehicle->GetPosition())){ if (pVehicle->GetIsOnScreen() && CRenderer::IsEntityCullZoneVisible(pVehicle)){ pVehicle->bFadeOut = true; }else{ @@ -712,9 +712,10 @@ CCarCtrl::PossiblyRemoveVehicle(CVehicle* pVehicle) (pVehicle->GetPosition() - vecPlayerPos).Magnitude2D() > 25.0f && !IsThisVehicleInteresting(pVehicle) && !pVehicle->bIsLocked && + pVehicle->CanBeDeleted() && !CTrafficLights::ShouldCarStopForLight(pVehicle, true) && !CTrafficLights::ShouldCarStopForBridge(pVehicle) && - !CGarages::IsPointWithinHideOutGarage(&pVehicle->GetPosition())){ + !CGarages::IsPointWithinHideOutGarage(pVehicle->GetPosition())){ CWorld::Remove(pVehicle); delete pVehicle; return; @@ -724,7 +725,7 @@ CCarCtrl::PossiblyRemoveVehicle(CVehicle* pVehicle) 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())){ + if (!CGarages::IsPointWithinHideOutGarage(pVehicle->GetPosition())){ CWorld::Remove(pVehicle); delete pVehicle; } diff --git a/src/control/Garages.cpp b/src/control/Garages.cpp index 0e9592dc..560a9c0c 100644 --- a/src/control/Garages.cpp +++ b/src/control/Garages.cpp @@ -69,7 +69,8 @@ bool CGarages::HasCarBeenCrushed(int32 handle) } WRAPPER void CGarages::TriggerMessage(const char *text, int16, uint16 time, int16) { EAXJMP(0x426B20); } -WRAPPER bool CGarages::IsPointWithinHideOutGarage(CVector*) { EAXJMP(0x428260); } +WRAPPER bool CGarages::IsPointWithinHideOutGarage(CVector&) { EAXJMP(0x428260); } +WRAPPER bool CGarages::IsPointWithinAnyGarage(CVector&) { EAXJMP(0x428320); } #if 0 WRAPPER void CGarages::PrintMessages(void) { EAXJMP(0x426310); } diff --git a/src/control/Garages.h b/src/control/Garages.h index 4c35fad1..cc5fb62b 100644 --- a/src/control/Garages.h +++ b/src/control/Garages.h @@ -25,5 +25,6 @@ public: static void TriggerMessage(const char *text, int16, uint16 time, int16); static void PrintMessages(void); static bool HasCarBeenCrushed(int32); - static bool IsPointWithinHideOutGarage(CVector*); + static bool IsPointWithinHideOutGarage(CVector&); + static bool IsPointWithinAnyGarage(CVector&); }; |