Rename LEVEL_NONE to LEVEL_GENERIC

This commit is contained in:
Sergeanur 2020-07-13 17:43:09 +03:00
parent 6eb8f6ae5a
commit 841fa5155c
27 changed files with 69 additions and 69 deletions

View File

@ -121,8 +121,8 @@ CGameLogic::Update()
CCarCtrl::ClearInterestingVehicleList(); CCarCtrl::ClearInterestingVehicleList();
CWorld::ClearExcitingStuffFromArea(pPlayerInfo.GetPos(), 4000.0f, 1); CWorld::ClearExcitingStuffFromArea(pPlayerInfo.GetPos(), 4000.0f, 1);
CRestart::FindClosestHospitalRestartPoint(pPlayerInfo.GetPos(), &vecRestartPos, &fRestartFloat); CRestart::FindClosestHospitalRestartPoint(pPlayerInfo.GetPos(), &vecRestartPos, &fRestartFloat);
CRestart::OverrideHospitalLevel = LEVEL_NONE; CRestart::OverrideHospitalLevel = LEVEL_GENERIC;
CRestart::OverridePoliceStationLevel = LEVEL_NONE; CRestart::OverridePoliceStationLevel = LEVEL_GENERIC;
PassTime(720); PassTime(720);
RestorePlayerStuffDuringResurrection(pPlayerInfo.m_pPed, vecRestartPos, fRestartFloat); RestorePlayerStuffDuringResurrection(pPlayerInfo.m_pPed, vecRestartPos, fRestartFloat);
SortOutStreamingAndMemory(pPlayerInfo.GetPos()); SortOutStreamingAndMemory(pPlayerInfo.GetPos());
@ -200,8 +200,8 @@ CGameLogic::Update()
CCarCtrl::ClearInterestingVehicleList(); CCarCtrl::ClearInterestingVehicleList();
CWorld::ClearExcitingStuffFromArea(pPlayerInfo.GetPos(), 4000.0f, 1); CWorld::ClearExcitingStuffFromArea(pPlayerInfo.GetPos(), 4000.0f, 1);
CRestart::FindClosestPoliceRestartPoint(pPlayerInfo.GetPos(), &vecRestartPos, &fRestartFloat); CRestart::FindClosestPoliceRestartPoint(pPlayerInfo.GetPos(), &vecRestartPos, &fRestartFloat);
CRestart::OverrideHospitalLevel = LEVEL_NONE; CRestart::OverrideHospitalLevel = LEVEL_GENERIC;
CRestart::OverridePoliceStationLevel = LEVEL_NONE; CRestart::OverridePoliceStationLevel = LEVEL_GENERIC;
PassTime(720); PassTime(720);
RestorePlayerStuffDuringResurrection(pPlayerInfo.m_pPed, vecRestartPos, fRestartFloat); RestorePlayerStuffDuringResurrection(pPlayerInfo.m_pPed, vecRestartPos, fRestartFloat);
pPlayerInfo.m_pPed->ClearWeapons(); pPlayerInfo.m_pPed->ClearWeapons();
@ -249,8 +249,8 @@ CGameLogic::Update()
CCarCtrl::ClearInterestingVehicleList(); CCarCtrl::ClearInterestingVehicleList();
CWorld::ClearExcitingStuffFromArea(pPlayerInfo.GetPos(), 4000.0f, 1); CWorld::ClearExcitingStuffFromArea(pPlayerInfo.GetPos(), 4000.0f, 1);
CRestart::FindClosestPoliceRestartPoint(pPlayerInfo.GetPos(), &vecRestartPos, &fRestartFloat); CRestart::FindClosestPoliceRestartPoint(pPlayerInfo.GetPos(), &vecRestartPos, &fRestartFloat);
CRestart::OverridePoliceStationLevel = LEVEL_NONE; CRestart::OverridePoliceStationLevel = LEVEL_GENERIC;
CRestart::OverrideHospitalLevel = LEVEL_NONE; CRestart::OverrideHospitalLevel = LEVEL_GENERIC;
RestorePlayerStuffDuringResurrection(pPlayerInfo.m_pPed, vecRestartPos, fRestartFloat); RestorePlayerStuffDuringResurrection(pPlayerInfo.m_pPed, vecRestartPos, fRestartFloat);
SortOutStreamingAndMemory(pPlayerInfo.GetPos()); SortOutStreamingAndMemory(pPlayerInfo.GetPos());
TheCamera.m_fCamShakeForce = 0.0f; TheCamera.m_fCamShakeForce = 0.0f;

View File

@ -426,8 +426,8 @@ void RemoveUnusedCollision(void)
"com_rvroads52", "com_roadsrv", "com_roadkb23", "com_roadkb22" "com_rvroads52", "com_roadsrv", "com_roadkb23", "com_roadkb22"
}; };
for (int i = 0; i < ARRAY_SIZE(dontDeleteArray); i++) for (int i = 0; i < ARRAY_SIZE(dontDeleteArray); i++)
CModelInfo::GetModelInfo(dontDeleteArray[i], nil)->GetColModel()->level = LEVEL_NONE; CModelInfo::GetModelInfo(dontDeleteArray[i], nil)->GetColModel()->level = LEVEL_GENERIC;
CModelInfo::RemoveColModelsFromOtherLevels(LEVEL_NONE); CModelInfo::RemoveColModelsFromOtherLevels(LEVEL_GENERIC);
for (int i = 0; i < ARRAY_SIZE(dontDeleteArray); i++) for (int i = 0; i < ARRAY_SIZE(dontDeleteArray); i++)
CModelInfo::GetModelInfo(dontDeleteArray[i], nil)->GetColModel()->level = LEVEL_COMMERCIAL; CModelInfo::GetModelInfo(dontDeleteArray[i], nil)->GetColModel()->level = LEVEL_COMMERCIAL;
} }

View File

@ -164,7 +164,7 @@ static void ApplyPanelDamageToCar(uint32 panels, CAutomobile* vehicle, bool flyi
void PrintElementsInPtrList(void) void PrintElementsInPtrList(void)
{ {
for (CPtrNode* node = CWorld::GetBigBuildingList(LEVEL_NONE).first; node; node = node->next) { for (CPtrNode* node = CWorld::GetBigBuildingList(LEVEL_GENERIC).first; node; node = node->next) {
/* Most likely debug print was present here */ /* Most likely debug print was present here */
} }
} }
@ -1124,7 +1124,7 @@ void CReplay::StoreStuffInMem(void)
pWorld1 = new uint8[sizeof(CSector) * NUMSECTORS_X * NUMSECTORS_Y]; pWorld1 = new uint8[sizeof(CSector) * NUMSECTORS_X * NUMSECTORS_Y];
memcpy(pWorld1, CWorld::GetSector(0, 0), NUMSECTORS_X * NUMSECTORS_Y * sizeof(CSector)); memcpy(pWorld1, CWorld::GetSector(0, 0), NUMSECTORS_X * NUMSECTORS_Y * sizeof(CSector));
WorldPtrList = CWorld::GetMovingEntityList().first; // why WorldPtrList = CWorld::GetMovingEntityList().first; // why
BigBuildingPtrList = CWorld::GetBigBuildingList(LEVEL_NONE).first; BigBuildingPtrList = CWorld::GetBigBuildingList(LEVEL_GENERIC).first;
pPickups = new uint8[sizeof(CPickup) * NUMPICKUPS]; pPickups = new uint8[sizeof(CPickup) * NUMPICKUPS];
memcpy(pPickups, CPickups::aPickUps, NUMPICKUPS * sizeof(CPickup)); memcpy(pPickups, CPickups::aPickUps, NUMPICKUPS * sizeof(CPickup));
pReferences = new uint8[(sizeof(CReference) * NUMREFERENCES)]; pReferences = new uint8[(sizeof(CReference) * NUMREFERENCES)];
@ -1170,7 +1170,7 @@ void CReplay::RestoreStuffFromMem(void)
delete[] pWorld1; delete[] pWorld1;
pWorld1 = nil; pWorld1 = nil;
CWorld::GetMovingEntityList().first = WorldPtrList; CWorld::GetMovingEntityList().first = WorldPtrList;
CWorld::GetBigBuildingList(LEVEL_NONE).first = BigBuildingPtrList; CWorld::GetBigBuildingList(LEVEL_GENERIC).first = BigBuildingPtrList;
memcpy(CPickups::aPickUps, pPickups, sizeof(CPickup) * NUMPICKUPS); memcpy(CPickups::aPickUps, pPickups, sizeof(CPickup) * NUMPICKUPS);
delete[] pPickups; delete[] pPickups;
pPickups = nil; pPickups = nil;

View File

@ -24,8 +24,8 @@ uint16 CRestart::NumberOfPoliceRestarts;
void void
CRestart::Initialise() CRestart::Initialise()
{ {
OverridePoliceStationLevel = LEVEL_NONE; OverridePoliceStationLevel = LEVEL_GENERIC;
OverrideHospitalLevel = LEVEL_NONE; OverrideHospitalLevel = LEVEL_GENERIC;
bFadeInAfterNextArrest = true; bFadeInAfterNextArrest = true;
bFadeInAfterNextDeath = true; bFadeInAfterNextDeath = true;
OverrideHeading = 0.0f; OverrideHeading = 0.0f;
@ -86,7 +86,7 @@ CRestart::FindClosestHospitalRestartPoint(const CVector &pos, CVector *outPos, f
// find closest point on this level // find closest point on this level
for (int i = 0; i < NumberOfHospitalRestarts; i++) { for (int i = 0; i < NumberOfHospitalRestarts; i++) {
if (CTheZones::FindZoneForPoint(HospitalRestartPoints[i]) == (OverrideHospitalLevel != LEVEL_NONE ? OverrideHospitalLevel : curlevel)) { if (CTheZones::FindZoneForPoint(HospitalRestartPoints[i]) == (OverrideHospitalLevel != LEVEL_GENERIC ? OverrideHospitalLevel : curlevel)) {
float dist = (pos - HospitalRestartPoints[i]).MagnitudeSqr(); float dist = (pos - HospitalRestartPoints[i]).MagnitudeSqr();
if (fMinDist >= dist) { if (fMinDist >= dist) {
fMinDist = dist; fMinDist = dist;
@ -133,7 +133,7 @@ CRestart::FindClosestPoliceRestartPoint(const CVector &pos, CVector *outPos, flo
// find closest point on this level // find closest point on this level
for (int i = 0; i < NumberOfPoliceRestarts; i++) { for (int i = 0; i < NumberOfPoliceRestarts; i++) {
if (CTheZones::FindZoneForPoint(PoliceRestartPoints[i]) == (OverridePoliceStationLevel != LEVEL_NONE ? OverridePoliceStationLevel : curlevel)) { if (CTheZones::FindZoneForPoint(PoliceRestartPoints[i]) == (OverridePoliceStationLevel != LEVEL_GENERIC ? OverridePoliceStationLevel : curlevel)) {
float dist = (pos - PoliceRestartPoints[i]).MagnitudeSqr(); float dist = (pos - PoliceRestartPoints[i]).MagnitudeSqr();
if (fMinDist >= dist) { if (fMinDist >= dist) {
fMinDist = dist; fMinDist = dist;

View File

@ -8708,7 +8708,7 @@ int8 CRunningScript::ProcessCommands800To899(int32 command)
CEntity* apEntities[16]; CEntity* apEntities[16];
CWorld::FindObjectsOfTypeInRange(mi, pos, range, true, &total, 16, apEntities, true, false, false, true, true); CWorld::FindObjectsOfTypeInRange(mi, pos, range, true, &total, 16, apEntities, true, false, false, true, true);
if (total == 0) if (total == 0)
CWorld::FindObjectsOfTypeInRangeSectorList(mi, CWorld::GetBigBuildingList(LEVEL_NONE), pos, range, true, &total, 16, apEntities); CWorld::FindObjectsOfTypeInRangeSectorList(mi, CWorld::GetBigBuildingList(LEVEL_GENERIC), pos, range, true, &total, 16, apEntities);
if (total == 0) if (total == 0)
CWorld::FindObjectsOfTypeInRangeSectorList(mi, CWorld::GetBigBuildingList(CTheZones::FindZoneForPoint(pos)), pos, range, true, &total, 16, apEntities); CWorld::FindObjectsOfTypeInRangeSectorList(mi, CWorld::GetBigBuildingList(CTheZones::FindZoneForPoint(pos)), pos, range, true, &total, 16, apEntities);
CEntity* pClosestEntity = nil; CEntity* pClosestEntity = nil;
@ -9460,7 +9460,7 @@ int8 CRunningScript::ProcessCommands900To999(int32 command)
CEntity* apEntities[16]; CEntity* apEntities[16];
CWorld::FindObjectsOfTypeInRange(mi1, pos, radius, true, &total, 16, apEntities, true, false, false, false, false); CWorld::FindObjectsOfTypeInRange(mi1, pos, radius, true, &total, 16, apEntities, true, false, false, false, false);
if (total == 0) if (total == 0)
CWorld::FindObjectsOfTypeInRangeSectorList(mi1, CWorld::GetBigBuildingList(LEVEL_NONE), pos, radius, true, &total, 16, apEntities); CWorld::FindObjectsOfTypeInRangeSectorList(mi1, CWorld::GetBigBuildingList(LEVEL_GENERIC), pos, radius, true, &total, 16, apEntities);
if (total == 0) if (total == 0)
CWorld::FindObjectsOfTypeInRangeSectorList(mi1, CWorld::GetBigBuildingList(CTheZones::FindZoneForPoint(pos)), pos, radius, true, &total, 16, apEntities); CWorld::FindObjectsOfTypeInRangeSectorList(mi1, CWorld::GetBigBuildingList(CTheZones::FindZoneForPoint(pos)), pos, radius, true, &total, 16, apEntities);
CEntity* pClosestEntity = nil; CEntity* pClosestEntity = nil;
@ -10062,7 +10062,7 @@ int8 CRunningScript::ProcessCommands1000To1099(int32 command)
if (ScriptParams[1]) if (ScriptParams[1])
pVehicle->m_nZoneLevel = CTheZones::GetLevelFromPosition(&pVehicle->GetPosition()); pVehicle->m_nZoneLevel = CTheZones::GetLevelFromPosition(&pVehicle->GetPosition());
else else
pVehicle->m_nZoneLevel = LEVEL_NONE; pVehicle->m_nZoneLevel = LEVEL_GENERIC;
return 0; return 0;
} }
case COMMAND_SET_CHAR_STAYS_IN_CURRENT_LEVEL: case COMMAND_SET_CHAR_STAYS_IN_CURRENT_LEVEL:
@ -10073,7 +10073,7 @@ int8 CRunningScript::ProcessCommands1000To1099(int32 command)
if (ScriptParams[1]) if (ScriptParams[1])
pPed->m_nZoneLevel = CTheZones::GetLevelFromPosition(&pPed->GetPosition()); pPed->m_nZoneLevel = CTheZones::GetLevelFromPosition(&pPed->GetPosition());
else else
pPed->m_nZoneLevel = LEVEL_NONE; pPed->m_nZoneLevel = LEVEL_GENERIC;
return 0; return 0;
} }
case COMMAND_REGISTER_4X4_ONE_TIME: case COMMAND_REGISTER_4X4_ONE_TIME:

View File

@ -38,7 +38,7 @@ void
CCollision::Init(void) CCollision::Init(void)
{ {
ms_colModelCache.Init(NUMCOLCACHELINKS); ms_colModelCache.Init(NUMCOLCACHELINKS);
ms_collisionInMemory = LEVEL_NONE; ms_collisionInMemory = LEVEL_GENERIC;
} }
void void
@ -59,7 +59,7 @@ CCollision::Update(void)
return; return;
// hardcode a level if there are no zones // hardcode a level if there are no zones
if(level == LEVEL_NONE){ if(level == LEVEL_GENERIC){
if(CGame::currLevel == LEVEL_INDUSTRIAL && if(CGame::currLevel == LEVEL_INDUSTRIAL &&
playerCoors.x < 400.0f){ playerCoors.x < 400.0f){
level = LEVEL_COMMERCIAL; level = LEVEL_COMMERCIAL;
@ -78,7 +78,7 @@ CCollision::Update(void)
} }
} }
} }
if(level != LEVEL_NONE && level != CGame::currLevel) if(level != LEVEL_GENERIC && level != CGame::currLevel)
CGame::currLevel = level; CGame::currLevel = level;
if(ms_collisionInMemory != CGame::currLevel) if(ms_collisionInMemory != CGame::currLevel)
LoadCollisionWhenINeedIt(forceLevelChange); LoadCollisionWhenINeedIt(forceLevelChange);
@ -95,10 +95,10 @@ GetCollisionInSectorList(CPtrList &list)
for(node = list.first; node; node = node->next){ for(node = list.first; node; node = node->next){
e = (CEntity*)node->item; e = (CEntity*)node->item;
level = CModelInfo::GetModelInfo(e->GetModelIndex())->GetColModel()->level; level = CModelInfo::GetModelInfo(e->GetModelIndex())->GetColModel()->level;
if(level != LEVEL_NONE) if(level != LEVEL_GENERIC)
return (eLevelName)level; return (eLevelName)level;
} }
return LEVEL_NONE; return LEVEL_GENERIC;
} }
// Get a level this sector is in based on collision models // Get a level this sector is in based on collision models
@ -108,15 +108,15 @@ GetCollisionInSector(CSector &sect)
int level; int level;
level = GetCollisionInSectorList(sect.m_lists[ENTITYLIST_BUILDINGS]); level = GetCollisionInSectorList(sect.m_lists[ENTITYLIST_BUILDINGS]);
if(level == LEVEL_NONE) if(level == LEVEL_GENERIC)
level = GetCollisionInSectorList(sect.m_lists[ENTITYLIST_BUILDINGS_OVERLAP]); level = GetCollisionInSectorList(sect.m_lists[ENTITYLIST_BUILDINGS_OVERLAP]);
if(level == LEVEL_NONE) if(level == LEVEL_GENERIC)
level = GetCollisionInSectorList(sect.m_lists[ENTITYLIST_OBJECTS]); level = GetCollisionInSectorList(sect.m_lists[ENTITYLIST_OBJECTS]);
if(level == LEVEL_NONE) if(level == LEVEL_GENERIC)
level = GetCollisionInSectorList(sect.m_lists[ENTITYLIST_OBJECTS_OVERLAP]); level = GetCollisionInSectorList(sect.m_lists[ENTITYLIST_OBJECTS_OVERLAP]);
if(level == LEVEL_NONE) if(level == LEVEL_GENERIC)
level = GetCollisionInSectorList(sect.m_lists[ENTITYLIST_DUMMIES]); level = GetCollisionInSectorList(sect.m_lists[ENTITYLIST_DUMMIES]);
if(level == LEVEL_NONE) if(level == LEVEL_GENERIC)
level = GetCollisionInSectorList(sect.m_lists[ENTITYLIST_DUMMIES_OVERLAP]); level = GetCollisionInSectorList(sect.m_lists[ENTITYLIST_DUMMIES_OVERLAP]);
return (eLevelName)level; return (eLevelName)level;
} }
@ -133,7 +133,7 @@ CCollision::LoadCollisionWhenINeedIt(bool forceChange)
int xmin, xmax, ymin, ymax; int xmin, xmax, ymin, ymax;
int x, y; int x, y;
level = LEVEL_NONE; level = LEVEL_GENERIC;
playerCoors = FindPlayerCoors(); playerCoors = FindPlayerCoors();
sx = CWorld::GetSectorIndexX(playerCoors.x); sx = CWorld::GetSectorIndexX(playerCoors.x);
@ -161,8 +161,8 @@ CCollision::LoadCollisionWhenINeedIt(bool forceChange)
for(x = xmin; x <= xmax; x++) for(x = xmin; x <= xmax; x++)
for(y = ymin; y <= ymax; y++){ for(y = ymin; y <= ymax; y++){
l = GetCollisionInSector(*CWorld::GetSector(x, y)); l = GetCollisionInSector(*CWorld::GetSector(x, y));
if(l != LEVEL_NONE){ if(l != LEVEL_GENERIC){
if(level == LEVEL_NONE) if(level == LEVEL_GENERIC)
level = l; level = l;
if(level != l) if(level != l)
multipleLevels = true; multipleLevels = true;
@ -173,7 +173,7 @@ CCollision::LoadCollisionWhenINeedIt(bool forceChange)
if(multipleLevels && veh && veh->IsBoat()) if(multipleLevels && veh && veh->IsBoat())
for(ei = veh->m_entryInfoList.first; ei; ei = ei->next){ for(ei = veh->m_entryInfoList.first; ei; ei = ei->next){
level = GetCollisionInSector(*ei->sector); level = GetCollisionInSector(*ei->sector);
if(level != LEVEL_NONE) if(level != LEVEL_GENERIC)
break; break;
} }
} }
@ -205,7 +205,7 @@ CCollision::LoadCollisionWhenINeedIt(bool forceChange)
ms_collisionInMemory = CGame::currLevel; ms_collisionInMemory = CGame::currLevel;
CReplay::EmptyReplayBuffer(); CReplay::EmptyReplayBuffer();
#ifndef NO_ISLAND_LOADING #ifndef NO_ISLAND_LOADING
if(CGame::currLevel != LEVEL_NONE) if(CGame::currLevel != LEVEL_GENERIC)
LoadSplash(GetLevelSplashScreen(CGame::currLevel)); LoadSplash(GetLevelSplashScreen(CGame::currLevel));
CStreaming::RemoveUnusedBigBuildings(CGame::currLevel); CStreaming::RemoveUnusedBigBuildings(CGame::currLevel);
CStreaming::RemoveUnusedBuildings(CGame::currLevel); CStreaming::RemoveUnusedBuildings(CGame::currLevel);
@ -232,7 +232,7 @@ CCollision::SortOutCollisionAfterLoad(void)
#ifndef NO_ISLAND_LOADING #ifndef NO_ISLAND_LOADING
CModelInfo::RemoveColModelsFromOtherLevels(CGame::currLevel); CModelInfo::RemoveColModelsFromOtherLevels(CGame::currLevel);
#endif #endif
if (CGame::currLevel != LEVEL_NONE) { if (CGame::currLevel != LEVEL_GENERIC) {
#ifdef NO_ISLAND_LOADING #ifdef NO_ISLAND_LOADING
static bool bAlreadyLoaded = false; static bool bAlreadyLoaded = false;
if (bAlreadyLoaded) { if (bAlreadyLoaded) {

View File

@ -357,7 +357,7 @@ bool CGame::Initialise(const char* datFile)
CStreaming::Init(); CStreaming::Init();
CStreaming::LoadInitialVehicles(); CStreaming::LoadInitialVehicles();
CStreaming::LoadInitialPeds(); CStreaming::LoadInitialPeds();
CStreaming::RequestBigBuildings(LEVEL_NONE); CStreaming::RequestBigBuildings(LEVEL_GENERIC);
CStreaming::LoadAllRequestedModels(false); CStreaming::LoadAllRequestedModels(false);
printf("Streaming uses %dK of its memory", CStreaming::ms_memoryUsed / 1024); printf("Streaming uses %dK of its memory", CStreaming::ms_memoryUsed / 1024);
LoadingScreen("Loading the Game", "Load animations", GetRandomSplashScreen()); LoadingScreen("Loading the Game", "Load animations", GetRandomSplashScreen());
@ -511,7 +511,7 @@ void CGame::ReInitGameObjectVariables(void)
CTimeCycle::Initialise(); CTimeCycle::Initialise();
CDraw::SetFOV(120.0f); CDraw::SetFOV(120.0f);
CDraw::ms_fLODDistance = 500.0f; CDraw::ms_fLODDistance = 500.0f;
CStreaming::RequestBigBuildings(LEVEL_NONE); CStreaming::RequestBigBuildings(LEVEL_GENERIC);
CStreaming::LoadAllRequestedModels(false); CStreaming::LoadAllRequestedModels(false);
CPed::Initialise(); CPed::Initialise();
CEventList::Initialise(); CEventList::Initialise();

View File

@ -2,7 +2,7 @@
enum eLevelName { enum eLevelName {
LEVEL_IGNORE = -1, // beware, this is only used in CPhysical's m_nZoneLevel LEVEL_IGNORE = -1, // beware, this is only used in CPhysical's m_nZoneLevel
LEVEL_NONE = 0, LEVEL_GENERIC = 0,
LEVEL_INDUSTRIAL, LEVEL_INDUSTRIAL,
LEVEL_COMMERCIAL, LEVEL_COMMERCIAL,
LEVEL_SUBURBAN LEVEL_SUBURBAN

View File

@ -553,7 +553,7 @@ CPlayerInfo::Process(void)
veh->m_nZoneLevel = LEVEL_IGNORE; veh->m_nZoneLevel = LEVEL_IGNORE;
for (int i = 0; i < ARRAY_SIZE(veh->pPassengers); i++) { for (int i = 0; i < ARRAY_SIZE(veh->pPassengers); i++) {
if (veh->pPassengers[i]) if (veh->pPassengers[i])
veh->pPassengers[i]->m_nZoneLevel = LEVEL_NONE; veh->pPassengers[i]->m_nZoneLevel = LEVEL_GENERIC;
} }
CStats::DistanceTravelledInVehicle += veh->m_fDistanceTravelled; CStats::DistanceTravelledInVehicle += veh->m_fDistanceTravelled;
} else { } else {

View File

@ -36,19 +36,19 @@ CTempColModels::Initialise(void)
#define SET_COLMODEL_SPHERES(colmodel, sphrs)\ #define SET_COLMODEL_SPHERES(colmodel, sphrs)\
colmodel.numSpheres = ARRAY_SIZE(sphrs);\ colmodel.numSpheres = ARRAY_SIZE(sphrs);\
colmodel.spheres = sphrs;\ colmodel.spheres = sphrs;\
colmodel.level = LEVEL_NONE;\ colmodel.level = LEVEL_GENERIC;\
colmodel.ownsCollisionVolumes = false;\ colmodel.ownsCollisionVolumes = false;\
int i; int i;
ms_colModelBBox.boundingSphere.Set(2.0f, CVector(0.0f, 0.0f, 0.0f), SURFACE_DEFAULT, 0); ms_colModelBBox.boundingSphere.Set(2.0f, CVector(0.0f, 0.0f, 0.0f), SURFACE_DEFAULT, 0);
ms_colModelBBox.boundingBox.Set(CVector(-2.0f, -2.0f, -2.0f), CVector(2.0f, 2.0f, 2.0f), SURFACE_DEFAULT, 0); ms_colModelBBox.boundingBox.Set(CVector(-2.0f, -2.0f, -2.0f), CVector(2.0f, 2.0f, 2.0f), SURFACE_DEFAULT, 0);
ms_colModelBBox.level = LEVEL_NONE; ms_colModelBBox.level = LEVEL_GENERIC;
for (i = 0; i < ARRAY_SIZE(ms_colModelCutObj); i++) { for (i = 0; i < ARRAY_SIZE(ms_colModelCutObj); i++) {
ms_colModelCutObj[i].boundingSphere.Set(2.0f, CVector(0.0f, 0.0f, 0.0f), SURFACE_DEFAULT, 0); ms_colModelCutObj[i].boundingSphere.Set(2.0f, CVector(0.0f, 0.0f, 0.0f), SURFACE_DEFAULT, 0);
ms_colModelCutObj[i].boundingBox.Set(CVector(-2.0f, -2.0f, -2.0f), CVector(2.0f, 2.0f, 2.0f), SURFACE_DEFAULT, 0); ms_colModelCutObj[i].boundingBox.Set(CVector(-2.0f, -2.0f, -2.0f), CVector(2.0f, 2.0f, 2.0f), SURFACE_DEFAULT, 0);
ms_colModelCutObj[i].level = LEVEL_NONE; ms_colModelCutObj[i].level = LEVEL_GENERIC;
} }
// Ped Spheres // Ped Spheres

View File

@ -1797,7 +1797,7 @@ CWorld::ClearForRestart(void)
CWorld::Remove(pEntity); CWorld::Remove(pEntity);
delete pEntity; delete pEntity;
} }
for(CPtrNode *pNode = GetBigBuildingList(LEVEL_NONE).first; pNode; pNode = pNode->next) { for(CPtrNode *pNode = GetBigBuildingList(LEVEL_GENERIC).first; pNode; pNode = pNode->next) {
CVehicle *pVehicle = (CVehicle *)pNode->item; CVehicle *pVehicle = (CVehicle *)pNode->item;
if(pVehicle && pVehicle->IsVehicle() && pVehicle->IsPlane()) { if(pVehicle && pVehicle->IsVehicle() && pVehicle->IsPlane()) {
CWorld::Remove(pVehicle); CWorld::Remove(pVehicle);

View File

@ -90,7 +90,7 @@ CTheZones::Init(void)
TotalNumberOfZoneInfos = 1; // why 1? TotalNumberOfZoneInfos = 1; // why 1?
TotalNumberOfZones = 1; TotalNumberOfZones = 1;
m_CurrLevel = LEVEL_NONE; m_CurrLevel = LEVEL_GENERIC;
m_pPlayersZone = &ZoneArray[0]; m_pPlayersZone = &ZoneArray[0];
strcpy(ZoneArray[0].name, "CITYZON"); strcpy(ZoneArray[0].name, "CITYZON");
@ -100,7 +100,7 @@ CTheZones::Init(void)
ZoneArray[0].maxx = 4000.0f; ZoneArray[0].maxx = 4000.0f;
ZoneArray[0].maxy = 4000.0f; ZoneArray[0].maxy = 4000.0f;
ZoneArray[0].maxz = 500.0f; ZoneArray[0].maxz = 500.0f;
ZoneArray[0].level = LEVEL_NONE; ZoneArray[0].level = LEVEL_GENERIC;
for(i = 0; i < NUMMAPZONES; i++){ for(i = 0; i < NUMMAPZONES; i++){
memset(&MapZoneArray[i], 0, sizeof(CZone)); memset(&MapZoneArray[i], 0, sizeof(CZone));
@ -116,7 +116,7 @@ CTheZones::Init(void)
MapZoneArray[0].maxx = 4000.0f; MapZoneArray[0].maxx = 4000.0f;
MapZoneArray[0].maxy = 4000.0f; MapZoneArray[0].maxy = 4000.0f;
MapZoneArray[0].maxz = 500.0f; MapZoneArray[0].maxz = 500.0f;
MapZoneArray[0].level = LEVEL_NONE; MapZoneArray[0].level = LEVEL_GENERIC;
} }
void void
@ -577,7 +577,7 @@ CTheZones::FindZoneForPoint(const CVector &pos)
return LEVEL_COMMERCIAL; return LEVEL_COMMERCIAL;
if(PointLiesWithinZone(&pos, GetZone(FindZoneByLabelAndReturnIndex("SUB_ZON")))) if(PointLiesWithinZone(&pos, GetZone(FindZoneByLabelAndReturnIndex("SUB_ZON"))))
return LEVEL_SUBURBAN; return LEVEL_SUBURBAN;
return LEVEL_NONE; return LEVEL_GENERIC;
} }
void void

View File

@ -17,6 +17,6 @@ CBuilding::ReplaceWithNewModel(int32 id)
m_modelIndex = id; m_modelIndex = id;
if(bIsBIGBuilding) if(bIsBIGBuilding)
if(m_level == LEVEL_NONE || m_level == CGame::currLevel) if(m_level == LEVEL_GENERIC || m_level == CGame::currLevel)
CStreaming::RequestModel(id, STREAMFLAGS_DONT_REMOVE); CStreaming::RequestModel(id, STREAMFLAGS_DONT_REMOVE);
} }

View File

@ -332,14 +332,14 @@ CEntity::SetupBigBuilding(void)
bStreamingDontDelete = true; bStreamingDontDelete = true;
bUsesCollision = false; bUsesCollision = false;
m_level = CTheZones::GetLevelFromPosition(&GetPosition()); m_level = CTheZones::GetLevelFromPosition(&GetPosition());
if(m_level == LEVEL_NONE){ if(m_level == LEVEL_GENERIC){
if(mi->GetTxdSlot() != CTxdStore::FindTxdSlot("generic")){ if(mi->GetTxdSlot() != CTxdStore::FindTxdSlot("generic")){
mi->SetTexDictionary("generic"); mi->SetTexDictionary("generic");
printf("%d:%s txd has been set to generic\n", m_modelIndex, mi->GetName()); printf("%d:%s txd has been set to generic\n", m_modelIndex, mi->GetName());
} }
} }
if(mi->m_lodDistances[0] > 2000.0f) if(mi->m_lodDistances[0] > 2000.0f)
m_level = LEVEL_NONE; m_level = LEVEL_GENERIC;
} }
CRect CRect

View File

@ -70,7 +70,7 @@ CPhysical::CPhysical(void)
#ifdef FIX_BUGS #ifdef FIX_BUGS
m_nSurfaceTouched = SURFACE_DEFAULT; m_nSurfaceTouched = SURFACE_DEFAULT;
#endif #endif
m_nZoneLevel = LEVEL_NONE; m_nZoneLevel = LEVEL_GENERIC;
} }
CPhysical::~CPhysical(void) CPhysical::~CPhysical(void)

View File

@ -226,7 +226,7 @@ CModelInfo::RemoveColModelsFromOtherLevels(eLevelName level)
mi = GetModelInfo(i); mi = GetModelInfo(i);
if(mi){ if(mi){
colmodel = mi->GetColModel(); colmodel = mi->GetColModel();
if(colmodel && colmodel->level != LEVEL_NONE && colmodel->level != level) if(colmodel && colmodel->level != LEVEL_GENERIC && colmodel->level != level)
colmodel->RemoveCollisionVolumes(); colmodel->RemoveCollisionVolumes();
} }
} }

View File

@ -265,7 +265,7 @@ CPedModelInfo::CreateHitColModel(void)
max.x = max.y = 0.5f; max.x = max.y = 0.5f;
max.z = 1.2f; max.z = 1.2f;
colmodel->boundingBox.Set(min, max, 0, 0); colmodel->boundingBox.Set(min, max, 0, 0);
colmodel->level = LEVEL_NONE; colmodel->level = LEVEL_GENERIC;
m_hitColModel = colmodel; m_hitColModel = colmodel;
} }
@ -349,7 +349,7 @@ CPedModelInfo::CreateHitColModelSkinned(RpClump *clump)
max.x = max.y = 0.5f; max.x = max.y = 0.5f;
max.z = 1.2f; max.z = 1.2f;
colmodel->boundingBox.Set(min, max, 0, 0); colmodel->boundingBox.Set(min, max, 0, 0);
colmodel->level = LEVEL_NONE; colmodel->level = LEVEL_GENERIC;
m_hitColModel = colmodel; m_hitColModel = colmodel;
} }

View File

@ -232,7 +232,7 @@ CCivilianPed::CivilianAI(void)
void void
CCivilianPed::ProcessControl(void) CCivilianPed::ProcessControl(void)
{ {
if (m_nZoneLevel > LEVEL_NONE && m_nZoneLevel != CCollision::ms_collisionInMemory) if (m_nZoneLevel > LEVEL_GENERIC && m_nZoneLevel != CCollision::ms_collisionInMemory)
return; return;
CPed::ProcessControl(); CPed::ProcessControl();

View File

@ -559,7 +559,7 @@ CCopPed::CopAI(void)
void void
CCopPed::ProcessControl(void) CCopPed::ProcessControl(void)
{ {
if (m_nZoneLevel > LEVEL_NONE && m_nZoneLevel != CCollision::ms_collisionInMemory) if (m_nZoneLevel > LEVEL_GENERIC && m_nZoneLevel != CCollision::ms_collisionInMemory)
return; return;
CPed::ProcessControl(); CPed::ProcessControl();

View File

@ -44,7 +44,7 @@ CEmergencyPed::InRange(CPed *victim)
void void
CEmergencyPed::ProcessControl(void) CEmergencyPed::ProcessControl(void)
{ {
if (m_nZoneLevel > LEVEL_NONE && m_nZoneLevel != CCollision::ms_collisionInMemory) if (m_nZoneLevel > LEVEL_GENERIC && m_nZoneLevel != CCollision::ms_collisionInMemory)
return; return;
CPed::ProcessControl(); CPed::ProcessControl();

View File

@ -9177,7 +9177,7 @@ CPed::ProcessControl(void)
CColPoint foundCol; CColPoint foundCol;
CEntity *foundEnt = nil; CEntity *foundEnt = nil;
if (m_nZoneLevel > LEVEL_NONE && m_nZoneLevel != CCollision::ms_collisionInMemory) if (m_nZoneLevel > LEVEL_GENERIC && m_nZoneLevel != CCollision::ms_collisionInMemory)
return; return;
int alpha = CVisibilityPlugins::GetClumpAlpha(GetClump()); int alpha = CVisibilityPlugins::GetClumpAlpha(GetClump());

View File

@ -394,7 +394,7 @@ CPopulation::FindCollisionZoneForCoors(CVector *coors, int *safeZoneOut, eLevelN
} }
// Then it's transition area // Then it's transition area
if (*safeZoneOut >= 0) if (*safeZoneOut >= 0)
*levelOut = LEVEL_NONE; *levelOut = LEVEL_GENERIC;
else else
*levelOut = CTheZones::GetLevelFromPosition(coors); *levelOut = CTheZones::GetLevelFromPosition(coors);
} }
@ -867,7 +867,7 @@ CPopulation::MoveCarsAndPedsOutOfAbandonedZones()
for (int poolIndex = poolSize - 1; poolIndex >= 0; poolIndex--) { for (int poolIndex = poolSize - 1; poolIndex >= 0; poolIndex--) {
CVehicle* veh = CPools::GetVehiclePool()->GetSlot(poolIndex); CVehicle* veh = CPools::GetVehiclePool()->GetSlot(poolIndex);
if (veh && veh->m_nZoneLevel == LEVEL_NONE && veh->IsCar()) { if (veh && veh->m_nZoneLevel == LEVEL_GENERIC && veh->IsCar()) {
if(veh->GetStatus() != STATUS_ABANDONED && veh->GetStatus() != STATUS_WRECKED && veh->GetStatus() != STATUS_PLAYER && if(veh->GetStatus() != STATUS_ABANDONED && veh->GetStatus() != STATUS_WRECKED && veh->GetStatus() != STATUS_PLAYER &&
veh->GetStatus() != STATUS_PLAYER_REMOTE) { veh->GetStatus() != STATUS_PLAYER_REMOTE) {
@ -876,7 +876,7 @@ CPopulation::MoveCarsAndPedsOutOfAbandonedZones()
CPopulation::FindCollisionZoneForCoors(&vehPos, &zone, &level); CPopulation::FindCollisionZoneForCoors(&vehPos, &zone, &level);
// Level 0 is transition zones, and we don't wanna touch cars on transition zones. // Level 0 is transition zones, and we don't wanna touch cars on transition zones.
if (level != LEVEL_NONE && level != CCollision::ms_collisionInMemory && vehPos.z > -4.0f) { if (level != LEVEL_GENERIC && level != CCollision::ms_collisionInMemory && vehPos.z > -4.0f) {
if (veh->bIsLocked || !veh->CanBeDeleted()) { if (veh->bIsLocked || !veh->CanBeDeleted()) {
switch (movedVehicleCount & 3) { switch (movedVehicleCount & 3) {
case 0: case 0:
@ -913,13 +913,13 @@ CPopulation::MoveCarsAndPedsOutOfAbandonedZones()
for (int poolIndex = poolSize - 1; poolIndex >= 0; poolIndex--) { for (int poolIndex = poolSize - 1; poolIndex >= 0; poolIndex--) {
CPed *ped = CPools::GetPedPool()->GetSlot(poolIndex); CPed *ped = CPools::GetPedPool()->GetSlot(poolIndex);
if (ped && ped->m_nZoneLevel == LEVEL_NONE && !ped->bInVehicle) { if (ped && ped->m_nZoneLevel == LEVEL_GENERIC && !ped->bInVehicle) {
CVector pedPos(ped->GetPosition()); CVector pedPos(ped->GetPosition());
CPopulation::FindCollisionZoneForCoors(&pedPos, &zone, &level); CPopulation::FindCollisionZoneForCoors(&pedPos, &zone, &level);
// Level 0 is transition zones, and we don't wanna touch peds on transition zones. // Level 0 is transition zones, and we don't wanna touch peds on transition zones.
if (level != LEVEL_NONE && level != CCollision::ms_collisionInMemory && pedPos.z > -4.0f) { if (level != LEVEL_GENERIC && level != CCollision::ms_collisionInMemory && pedPos.z > -4.0f) {
if (ped->CanBeDeleted()) { if (ped->CanBeDeleted()) {
CWorld::Remove(ped); CWorld::Remove(ped);
delete ped; delete ped;

View File

@ -706,11 +706,11 @@ CRenderer::ScanWorld(void)
ScanBigBuildingList(CWorld::GetBigBuildingList(LEVEL_SUBURBAN)); ScanBigBuildingList(CWorld::GetBigBuildingList(LEVEL_SUBURBAN));
#else #else
#ifdef FIX_BUGS #ifdef FIX_BUGS
if (CCollision::ms_collisionInMemory != LEVEL_NONE) if (CCollision::ms_collisionInMemory != LEVEL_GENERIC)
#endif #endif
ScanBigBuildingList(CWorld::GetBigBuildingList(CCollision::ms_collisionInMemory)); ScanBigBuildingList(CWorld::GetBigBuildingList(CCollision::ms_collisionInMemory));
#endif #endif
ScanBigBuildingList(CWorld::GetBigBuildingList(LEVEL_NONE)); ScanBigBuildingList(CWorld::GetBigBuildingList(LEVEL_GENERIC));
} }
} }
} }

View File

@ -489,7 +489,7 @@ CheckDataNotCorrupt(int32 slot, char *name)
char filename[100]; char filename[100];
int32 blocknum = 0; int32 blocknum = 0;
eLevelName level = LEVEL_NONE; eLevelName level = LEVEL_GENERIC;
CheckSum = 0; CheckSum = 0;
uint32 bytes_processed = 0; uint32 bytes_processed = 0;
sprintf(filename, "%s%i%s", DefaultPCSaveFileName, slot + 1, ".b"); sprintf(filename, "%s%i%s", DefaultPCSaveFileName, slot + 1, ".b");

View File

@ -230,7 +230,7 @@ CAutomobile::ProcessControl(void)
bWarnedPeds = false; bWarnedPeds = false;
// skip if the collision isn't for the current level // skip if the collision isn't for the current level
if(colModel->level > LEVEL_NONE && colModel->level != CCollision::ms_collisionInMemory) if(colModel->level > LEVEL_GENERIC && colModel->level != CCollision::ms_collisionInMemory)
return; return;
// Improve grip of vehicles in certain cases // Improve grip of vehicles in certain cases

View File

@ -109,7 +109,7 @@ CBoat::GetComponentWorldPosition(int32 component, CVector &pos)
void void
CBoat::ProcessControl(void) CBoat::ProcessControl(void)
{ {
if(m_nZoneLevel > LEVEL_NONE && m_nZoneLevel != CCollision::ms_collisionInMemory) if(m_nZoneLevel > LEVEL_GENERIC && m_nZoneLevel != CCollision::ms_collisionInMemory)
return; return;
bool onLand = m_fDamageImpulse > 0.0f && m_vecDamageNormal.z > 0.1f; bool onLand = m_fDamageImpulse > 0.0f && m_vecDamageNormal.z > 0.1f;

View File

@ -83,7 +83,7 @@ CPlane::CPlane(int32 id, uint8 CreatedBy)
SetStatus(STATUS_PLANE); SetStatus(STATUS_PLANE);
bIsBIGBuilding = true; bIsBIGBuilding = true;
m_level = LEVEL_NONE; m_level = LEVEL_GENERIC;
#ifdef FIX_BUGS #ifdef FIX_BUGS
m_isFarAway = true; m_isFarAway = true;