summaryrefslogtreecommitdiffstats
path: root/src/control/CarCtrl.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/control/CarCtrl.cpp')
-rw-r--r--src/control/CarCtrl.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/control/CarCtrl.cpp b/src/control/CarCtrl.cpp
index 2c5751a3..66e29b6c 100644
--- a/src/control/CarCtrl.cpp
+++ b/src/control/CarCtrl.cpp
@@ -606,14 +606,18 @@ CCarCtrl::ChooseModel(CZoneInfo* pZone, CVector* pPos, int* pClass) {
continue;
}
- for (int i = 0; i < NUM_GANG_CAR_CLASSES; i++) {
+ int j;
+ for (j = 0; j < NUM_GANG_CAR_CLASSES; j++) {
if (rnd < pZone->gangThreshold[i]) {
- *pClass = i + FIRST_GANG_CAR_RATING;
- model = ChooseGangCarModel(i);
- continue;
+ *pClass = j + FIRST_GANG_CAR_RATING;
+ model = ChooseGangCarModel(j);
+ break;
}
}
+ if (j != NUM_GANG_CAR_CLASSES)
+ continue;
+
*pClass = ChooseCarRating(pZone);
model = ChooseCarModel(*pClass);
}