summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNikolay Korolev <nickvnuk@gmail.com>2020-05-08 16:05:54 +0200
committerNikolay Korolev <nickvnuk@gmail.com>2020-05-08 16:05:54 +0200
commit6065f5e52b592abb6e1df166db7beb3722d12149 (patch)
treeecf215192d9f334a2010640b02413836cc2ec65d
parentzone info commands + fix (diff)
downloadre3-6065f5e52b592abb6e1df166db7beb3722d12149.tar
re3-6065f5e52b592abb6e1df166db7beb3722d12149.tar.gz
re3-6065f5e52b592abb6e1df166db7beb3722d12149.tar.bz2
re3-6065f5e52b592abb6e1df166db7beb3722d12149.tar.lz
re3-6065f5e52b592abb6e1df166db7beb3722d12149.tar.xz
re3-6065f5e52b592abb6e1df166db7beb3722d12149.tar.zst
re3-6065f5e52b592abb6e1df166db7beb3722d12149.zip
-rw-r--r--src/control/CarCtrl.cpp3
-rw-r--r--src/core/Streaming.cpp7
2 files changed, 5 insertions, 5 deletions
diff --git a/src/control/CarCtrl.cpp b/src/control/CarCtrl.cpp
index 627e608c..2c5751a3 100644
--- a/src/control/CarCtrl.cpp
+++ b/src/control/CarCtrl.cpp
@@ -653,13 +653,16 @@ CCarCtrl::RemoveFromLoadedVehicleArray(int mi, int32 rating)
while (LoadedCarsArray[rating][index] != -1) {
if (LoadedCarsArray[rating][index] == mi)
break;
+ index++;
}
+ assert(LoadedCarsArray[rating][index] == mi);
int32 freq = CarFreqArrays[rating][index];
if (index > 0)
freq -= CarFreqArrays[rating][index - 1];
while (LoadedCarsArray[rating][index + 1] != -1) {
LoadedCarsArray[rating][index] = LoadedCarsArray[rating][index + 1];
CarFreqArrays[rating][index] = CarFreqArrays[rating][index + 1] - freq;
+ index++;
}
--NumOfLoadedCarsOfRating[rating];
}
diff --git a/src/core/Streaming.cpp b/src/core/Streaming.cpp
index 9ff34cdf..e989ad85 100644
--- a/src/core/Streaming.cpp
+++ b/src/core/Streaming.cpp
@@ -1164,9 +1164,9 @@ found:
}
else{
RemoveModel(id);
- CVehicleModelInfo* pVehicleInfo = (CVehicleModelInfo*)CModelInfo::GetModelInfo(modelId);
+ CVehicleModelInfo* pVehicleInfo = (CVehicleModelInfo*)CModelInfo::GetModelInfo(id);
if (pVehicleInfo->m_vehicleClass != -1)
- CCarCtrl::RemoveFromLoadedVehicleArray(modelId, pVehicleInfo->m_vehicleClass);
+ CCarCtrl::RemoveFromLoadedVehicleArray(id, pVehicleInfo->m_vehicleClass);
}
}
@@ -1305,11 +1305,8 @@ CStreaming::StreamVehiclesAndPeds(void)
mostRequestedRating = i;
}
}
- debug("selected %d with %d\n", mostRequestedRating, maxReq);
model = CCarCtrl::ChooseCarModelToLoad(mostRequestedRating);
- debug("selected %d\n", model);
if(!HasModelLoaded(model)){
- debug("requested %d\n", model);
RequestModel(model, STREAMFLAGS_DEPENDENCY);
timeBeforeNextLoad = 350;
}