summaryrefslogtreecommitdiff
path: root/src/control/CarCtrl.cpp
diff options
context:
space:
mode:
authorNikolay Korolev <nickvnuk@gmail.com>2019-10-26 17:20:31 +0300
committerNikolay Korolev <nickvnuk@gmail.com>2019-10-26 17:20:31 +0300
commit3dee880c2941417c9e5ec42297da65f27ab9c5ca (patch)
tree93f0daf6f0fdc04fb2898a202157d3d9ec078ffb /src/control/CarCtrl.cpp
parent542e746f66593ac63eb1a269ba9708593a627b24 (diff)
parent35bd3f514d2a673cf17db78103b17c169d2027e1 (diff)
merge
Diffstat (limited to 'src/control/CarCtrl.cpp')
-rw-r--r--src/control/CarCtrl.cpp6
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;