diff options
author | Sergeanur <s.anureev@yandex.ua> | 2019-10-16 23:53:25 +0200 |
---|---|---|
committer | Sergeanur <s.anureev@yandex.ua> | 2019-10-16 23:53:25 +0200 |
commit | 5b1ffb09124c7427b7efb421091179ddecc725c4 (patch) | |
tree | ac2d216a9aa6b79359371fe73b400c44fc5bca6e /src/control/CarCtrl.cpp | |
parent | Merge pull request #244 from Nick007J/master (diff) | |
download | re3-5b1ffb09124c7427b7efb421091179ddecc725c4.tar re3-5b1ffb09124c7427b7efb421091179ddecc725c4.tar.gz re3-5b1ffb09124c7427b7efb421091179ddecc725c4.tar.bz2 re3-5b1ffb09124c7427b7efb421091179ddecc725c4.tar.lz re3-5b1ffb09124c7427b7efb421091179ddecc725c4.tar.xz re3-5b1ffb09124c7427b7efb421091179ddecc725c4.tar.zst re3-5b1ffb09124c7427b7efb421091179ddecc725c4.zip |
Diffstat (limited to 'src/control/CarCtrl.cpp')
-rw-r--r-- | src/control/CarCtrl.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/control/CarCtrl.cpp b/src/control/CarCtrl.cpp index fd6d8057..cf77b5a4 100644 --- a/src/control/CarCtrl.cpp +++ b/src/control/CarCtrl.cpp @@ -648,8 +648,7 @@ CCarCtrl::AddToCarArray(int32 id, int32 vehclass) void CCarCtrl::RemoveDistantCars() { - uint32 i = CPools::GetVehiclePool()->GetSize(); - while (--i){ + for (int i = CPools::GetVehiclePool()->GetSize()-1; i >= 0; i--) { CVehicle* pVehicle = CPools::GetVehiclePool()->GetSlot(i); if (!pVehicle) continue; @@ -733,8 +732,7 @@ int32 CCarCtrl::CountCarsOfType(int32 mi) { int32 total = 0; - uint32 i = CPools::GetVehiclePool()->GetSize(); - while (i--){ + for (int i = CPools::GetVehiclePool()->GetSize()-1; i >= 0; i--) { CVehicle* pVehicle = CPools::GetVehiclePool()->GetSlot(i); if (!pVehicle) continue; |