summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorNikolay Korolev <nickvnuk@gmail.com>2020-05-08 17:50:16 +0200
committerNikolay Korolev <nickvnuk@gmail.com>2020-05-08 17:50:16 +0200
commitf902136b6af53ec75eb3df44f06e0d0972a7e7f6 (patch)
tree53a0a6e57b54fa0b7dba1a1c5ae19bf5165eef27 /src
parentgang (diff)
downloadre3-f902136b6af53ec75eb3df44f06e0d0972a7e7f6.tar
re3-f902136b6af53ec75eb3df44f06e0d0972a7e7f6.tar.gz
re3-f902136b6af53ec75eb3df44f06e0d0972a7e7f6.tar.bz2
re3-f902136b6af53ec75eb3df44f06e0d0972a7e7f6.tar.lz
re3-f902136b6af53ec75eb3df44f06e0d0972a7e7f6.tar.xz
re3-f902136b6af53ec75eb3df44f06e0d0972a7e7f6.tar.zst
re3-f902136b6af53ec75eb3df44f06e0d0972a7e7f6.zip
Diffstat (limited to 'src')
-rw-r--r--src/control/CarCtrl.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/control/CarCtrl.cpp b/src/control/CarCtrl.cpp
index ed14c6a0..66e29b6c 100644
--- a/src/control/CarCtrl.cpp
+++ b/src/control/CarCtrl.cpp
@@ -597,8 +597,7 @@ CCarCtrl::ChooseCarRating(CZoneInfo* pZoneInfo)
int32
CCarCtrl::ChooseModel(CZoneInfo* pZone, CVector* pPos, int* pClass) {
int32 model = -1;
- int i;
- for (i = 0; i < 10 && (model == -1 || !CStreaming::HasModelLoaded(model)); i++) {
+ for (int i = 0; i < 10 && (model == -1 || !CStreaming::HasModelLoaded(model)); i++) {
int rnd = CGeneral::GetRandomNumberInRange(0, 1000);
if (rnd < pZone->copThreshold) {
@@ -607,15 +606,16 @@ CCarCtrl::ChooseModel(CZoneInfo* pZone, CVector* pPos, int* pClass) {
continue;
}
- for (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);
+ *pClass = j + FIRST_GANG_CAR_RATING;
+ model = ChooseGangCarModel(j);
break;
}
}
- if (i != NUM_GANG_CAR_CLASSES)
+ if (j != NUM_GANG_CAR_CLASSES)
continue;
*pClass = ChooseCarRating(pZone);