diff options
author | erorcun <erorcunerorcun@hotmail.com.tr> | 2021-01-29 01:44:12 +0100 |
---|---|---|
committer | erorcun <erorcunerorcun@hotmail.com.tr> | 2021-01-29 17:16:26 +0100 |
commit | c4328afce7e2a0b48b9d0d2b225496e29fff1c0a (patch) | |
tree | cbed53aea63f025992b16be9b8ad1d13097df20b /src/control | |
parent | Fix some UBs (diff) | |
download | re3-c4328afce7e2a0b48b9d0d2b225496e29fff1c0a.tar re3-c4328afce7e2a0b48b9d0d2b225496e29fff1c0a.tar.gz re3-c4328afce7e2a0b48b9d0d2b225496e29fff1c0a.tar.bz2 re3-c4328afce7e2a0b48b9d0d2b225496e29fff1c0a.tar.lz re3-c4328afce7e2a0b48b9d0d2b225496e29fff1c0a.tar.xz re3-c4328afce7e2a0b48b9d0d2b225496e29fff1c0a.tar.zst re3-c4328afce7e2a0b48b9d0d2b225496e29fff1c0a.zip |
Diffstat (limited to 'src/control')
-rw-r--r-- | src/control/Garages.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/control/Garages.cpp b/src/control/Garages.cpp index e3b5aa8c..333f3a6f 100644 --- a/src/control/Garages.cpp +++ b/src/control/Garages.cpp @@ -1997,7 +1997,11 @@ float CGarages::FindDoorHeightForMI(int32 mi) void CGarage::TidyUpGarage() { uint32 i = CPools::GetVehiclePool()->GetSize(); +#ifdef FIX_BUGS while (i--) { +#else + while (--i) { +#endif CVehicle* pVehicle = CPools::GetVehiclePool()->GetSlot(i); if (pVehicle && (pVehicle->IsCar() || pVehicle->IsBike())) { if (IsPointInsideGarage(pVehicle->GetPosition())) { @@ -2013,7 +2017,11 @@ void CGarage::TidyUpGarage() void CGarage::TidyUpGarageClose() { uint32 i = CPools::GetVehiclePool()->GetSize(); +#ifdef FIX_BUGS while (i--) { +#else + while (--i) { +#endif CVehicle* pVehicle = CPools::GetVehiclePool()->GetSlot(i); if (!pVehicle) continue; |