1
0
Fork 0
mirror of https://github.com/halpz/re3.git synced 2024-12-26 18:15:27 +00:00
This commit is contained in:
Nikolay Korolev 2020-05-08 18:48:44 +03:00
parent 1ef8d61f36
commit 75943a57b2
2 changed files with 16 additions and 11 deletions

View file

@ -597,7 +597,8 @@ CCarCtrl::ChooseCarRating(CZoneInfo* pZoneInfo)
int32
CCarCtrl::ChooseModel(CZoneInfo* pZone, CVector* pPos, int* pClass) {
int32 model = -1;
for (int i = 0; i < 10 && (model == -1 || !CStreaming::HasModelLoaded(model)); i++) {
int i;
for (i = 0; i < 10 && (model == -1 || !CStreaming::HasModelLoaded(model)); i++) {
int rnd = CGeneral::GetRandomNumberInRange(0, 1000);
if (rnd < pZone->copThreshold) {
@ -606,14 +607,17 @@ CCarCtrl::ChooseModel(CZoneInfo* pZone, CVector* pPos, int* pClass) {
continue;
}
for (int i = 0; i < NUM_GANG_CAR_CLASSES; i++) {
for (i = 0; i < NUM_GANG_CAR_CLASSES; i++) {
if (rnd < pZone->gangThreshold[i]) {
*pClass = i + FIRST_GANG_CAR_RATING;
model = ChooseGangCarModel(i);
continue;
break;
}
}
if (i != NUM_GANG_CAR_CLASSES)
continue;
*pClass = ChooseCarRating(pZone);
model = ChooseCarModel(*pClass);
}

View file

@ -1342,10 +1342,11 @@ CStreaming::StreamZoneModels(const CVector &pos)
for(i = 0; i < NUMMODELSPERPEDGROUP; i++){
if(CPopulation::ms_pPedGroups[ms_currentPedGrp].models[i] == -1)
break;
RequestModel(CPopulation::ms_pPedGroups[ms_currentPedGrp].models[i], STREAMFLAGS_DONT_REMOVE);
RequestModel(CPopulation::ms_pPedGroups[ms_currentPedGrp].models[i], STREAMFLAGS_DEPENDENCY);
}
}
RequestModel(MI_MALE01, STREAMFLAGS_DONT_REMOVE);
//RequestModel(MI_HMOCA, STREAMFLAGS_DONT_REMOVE);
gangsToLoad = 0;
gangCarsToLoad = 0;
@ -1369,8 +1370,8 @@ CStreaming::StreamZoneModels(const CVector &pos)
bit = 1<<i;
if(gangsToLoad & bit && (ms_loadedGangs & bit) == 0){
RequestModel(MI_GANG01 + i*2, STREAMFLAGS_DONT_REMOVE);
RequestModel(MI_GANG01 + i*2 + 1, STREAMFLAGS_DONT_REMOVE);
RequestModel(MI_GANG01 + i*2, STREAMFLAGS_DEPENDENCY);
RequestModel(MI_GANG01 + i*2 + 1, STREAMFLAGS_DEPENDENCY);
ms_loadedGangs |= bit;
}else if((gangsToLoad & bit) == 0 && ms_loadedGangs & bit){
SetModelIsDeletable(MI_GANG01 + i*2);
@ -1380,12 +1381,12 @@ CStreaming::StreamZoneModels(const CVector &pos)
ms_loadedGangs &= ~bit;
}
// TODO(MIAMI): check this
if(CGangs::GetGangInfo(i)->m_nVehicleMI < 0)
continue;
// TODO(MIAMI): check this
if(CGangs::GetGangInfo(i)->m_nVehicleMI < 0)
continue;
if(gangCarsToLoad & bit && (ms_loadedGangCars & bit) == 0){
RequestModel(CGangs::GetGangInfo(i)->m_nVehicleMI, STREAMFLAGS_DONT_REMOVE);
if((gangCarsToLoad & bit) && (ms_loadedGangCars & bit) == 0){
RequestModel(CGangs::GetGangInfo(i)->m_nVehicleMI, STREAMFLAGS_DEPENDENCY);
}else if((gangCarsToLoad & bit) == 0 && ms_loadedGangCars & bit){
SetModelIsDeletable(CGangs::GetGangInfo(i)->m_nVehicleMI);
SetModelTxdIsDeletable(CGangs::GetGangInfo(i)->m_nVehicleMI);