diff options
author | aap <aap@papnet.eu> | 2020-05-08 18:32:32 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-08 18:32:32 +0200 |
commit | 87ea37248ffa9b82548b7bddc1dc05845becf0ee (patch) | |
tree | 53a0a6e57b54fa0b7dba1a1c5ae19bf5165eef27 /src/control/CarCtrl.cpp | |
parent | Merge branch 'master' into miami (diff) | |
parent | fix (diff) | |
download | re3-87ea37248ffa9b82548b7bddc1dc05845becf0ee.tar re3-87ea37248ffa9b82548b7bddc1dc05845becf0ee.tar.gz re3-87ea37248ffa9b82548b7bddc1dc05845becf0ee.tar.bz2 re3-87ea37248ffa9b82548b7bddc1dc05845becf0ee.tar.lz re3-87ea37248ffa9b82548b7bddc1dc05845becf0ee.tar.xz re3-87ea37248ffa9b82548b7bddc1dc05845becf0ee.tar.zst re3-87ea37248ffa9b82548b7bddc1dc05845becf0ee.zip |
Diffstat (limited to '')
-rw-r--r-- | src/control/CarCtrl.cpp | 12 |
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); } |