summaryrefslogtreecommitdiffstats
path: root/src/control
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/control/CarCtrl.cpp4
-rw-r--r--src/control/Garages.cpp5
-rw-r--r--src/control/Script.cpp66
3 files changed, 51 insertions, 24 deletions
diff --git a/src/control/CarCtrl.cpp b/src/control/CarCtrl.cpp
index cd08753d..036c947c 100644
--- a/src/control/CarCtrl.cpp
+++ b/src/control/CarCtrl.cpp
@@ -950,6 +950,10 @@ CCarCtrl::RemoveCarsIfThePoolGetsFull(void)
void
CCarCtrl::PossiblyRemoveVehicle(CVehicle* pVehicle)
{
+#ifdef FIX_BUGS
+ if (pVehicle->bIsLocked)
+ return;
+#endif
CVector vecPlayerPos = FindPlayerCentreOfWorld(CWorld::PlayerInFocus);
/* BUG: this variable is initialized only in if-block below but can be used outside of it. */
if (!IsThisVehicleInteresting(pVehicle) && !pVehicle->bIsLocked &&
diff --git a/src/control/Garages.cpp b/src/control/Garages.cpp
index e7b5ebe6..9aba431c 100644
--- a/src/control/Garages.cpp
+++ b/src/control/Garages.cpp
@@ -1324,7 +1324,7 @@ void CGarage::RemoveCarsBlockingDoorNotInside()
if (!IsEntityTouching3D(pVehicle))
continue;
if (!IsPointInsideGarage(pVehicle->GetPosition())) {
- if (pVehicle->bIsLocked && pVehicle->CanBeDeleted()) {
+ if (!pVehicle->bIsLocked && pVehicle->CanBeDeleted()) {
CWorld::Remove(pVehicle);
delete pVehicle;
return; // WHY?
@@ -1817,8 +1817,9 @@ CVehicle* CStoredCar::RestoreCar()
pVehicle->m_nRadioStation = m_nRadioStation;
pVehicle->bFreebies = false;
#ifdef FIX_BUGS
- ((CAutomobile*)pVehicle)->m_bombType = m_nCarBombType;
+ if (pVehicle->IsCar())
#endif
+ ((CAutomobile*)pVehicle)->m_bombType = m_nCarBombType;
pVehicle->bHasBeenOwnedByPlayer = true;
pVehicle->m_nDoorLock = CARLOCK_UNLOCKED;
pVehicle->bBulletProof = m_bBulletproof;
diff --git a/src/control/Script.cpp b/src/control/Script.cpp
index e3ee5503..82379f7e 100644
--- a/src/control/Script.cpp
+++ b/src/control/Script.cpp
@@ -10228,11 +10228,11 @@ int8 CRunningScript::ProcessCommands900To999(int32 command)
return 0;
CVehicle* car;
if (CModelInfo::IsBikeModel(model)) {
- car = new CBike(model, MISSION_VEHICLE);
+ car = new CBike(model, RANDOM_VEHICLE);
((CBike*)(car))->bIsStanding = true;
}
else
- car = new CAutomobile(model, MISSION_VEHICLE);
+ car = new CAutomobile(model, RANDOM_VEHICLE);
CVector pos = *(CVector*)&ScriptParams[0];
pos.z += car->GetDistanceFromCentreOfMassToBaseOfModel();
car->SetPosition(pos);
@@ -10590,15 +10590,21 @@ int8 CRunningScript::ProcessCommands1000To1099(int32 command)
CollectParameters(&m_nIp, 1);
CTimer::Stop();
CGame::currLevel = (eLevelName)ScriptParams[0];
-#ifndef NO_ISLAND_LOADING
- CStreaming::RemoveUnusedBigBuildings(CGame::currLevel);
- CStreaming::RemoveUnusedBuildings(CGame::currLevel);
+#ifdef NO_ISLAND_LOADING
+ if (CMenuManager::m_PrefsIslandLoading == CMenuManager::ISLAND_LOADING_LOW)
#endif
+ {
+ CStreaming::RemoveUnusedBigBuildings(CGame::currLevel);
+ CStreaming::RemoveUnusedBuildings(CGame::currLevel);
+ }
CCollision::SortOutCollisionAfterLoad();
-#ifndef NO_ISLAND_LOADING
- CStreaming::RequestIslands(CGame::currLevel);
- CStreaming::LoadAllRequestedModels(true);
+#ifdef NO_ISLAND_LOADING
+ if (CMenuManager::m_PrefsIslandLoading != CMenuManager::ISLAND_LOADING_HIGH)
#endif
+ {
+ CStreaming::RequestIslands(CGame::currLevel);
+ CStreaming::LoadAllRequestedModels(true);
+ }
CTimer::Update();
return 0;
}
@@ -10924,7 +10930,7 @@ int8 CRunningScript::ProcessCommands1000To1099(int32 command)
#ifdef USE_MEASUREMENTS_IN_METERS
UpdateCompareFlag(true);
#else
- UpdateCompareFlag(false)
+ UpdateCompareFlag(false);
#endif
return 0;
case COMMAND_CONVERT_METRES_TO_FEET:
@@ -11277,24 +11283,40 @@ int8 CRunningScript::ProcessCommands1100To1199(int32 command)
CTimer::Stop();
CGame::currLevel = (eLevelName)ScriptParams[0];
if (CGame::currLevel != CCollision::ms_collisionInMemory) {
-#ifndef NO_ISLAND_LOADING
- DMAudio.SetEffectsFadeVol(0);
- CPad::StopPadsShaking();
- CCollision::LoadCollisionScreen(CGame::currLevel);
- DMAudio.Service();
+#ifdef NO_ISLAND_LOADING
+ if (CMenuManager::m_PrefsIslandLoading == CMenuManager::ISLAND_LOADING_LOW)
#endif
+ {
+ DMAudio.SetEffectsFadeVol(0);
+ CPad::StopPadsShaking();
+ CCollision::LoadCollisionScreen(CGame::currLevel);
+ DMAudio.Service();
+ }
CPopulation::DealWithZoneChange(CCollision::ms_collisionInMemory, CGame::currLevel, false);
-#ifndef NO_ISLAND_LOADING
- CStreaming::RemoveUnusedBigBuildings(CGame::currLevel);
- CStreaming::RemoveUnusedBuildings(CGame::currLevel);
+#ifdef NO_ISLAND_LOADING
+ if (CMenuManager::m_PrefsIslandLoading == CMenuManager::ISLAND_LOADING_LOW)
#endif
+ {
+ CStreaming::RemoveUnusedBigBuildings(CGame::currLevel);
+ CStreaming::RemoveUnusedBuildings(CGame::currLevel);
+ }
CCollision::SortOutCollisionAfterLoad();
-#ifndef NO_ISLAND_LOADING
- CStreaming::RequestIslands(CGame::currLevel);
- CStreaming::RequestBigBuildings(CGame::currLevel);
- CStreaming::LoadAllRequestedModels(true);
- DMAudio.SetEffectsFadeVol(127);
+#ifdef NO_ISLAND_LOADING
+ if (CMenuManager::m_PrefsIslandLoading != CMenuManager::ISLAND_LOADING_HIGH)
+#endif
+ CStreaming::RequestIslands(CGame::currLevel);
+#ifdef NO_ISLAND_LOADING
+ if (CMenuManager::m_PrefsIslandLoading == CMenuManager::ISLAND_LOADING_LOW)
+#endif
+ CStreaming::RequestBigBuildings(CGame::currLevel);
+#ifdef NO_ISLAND_LOADING
+ if (CMenuManager::m_PrefsIslandLoading != CMenuManager::ISLAND_LOADING_HIGH)
+#endif
+ CStreaming::LoadAllRequestedModels(true);
+#ifdef NO_ISLAND_LOADING
+ if (CMenuManager::m_PrefsIslandLoading == CMenuManager::ISLAND_LOADING_LOW)
#endif
+ DMAudio.SetEffectsFadeVol(127);
}
CTimer::Update();
return 0;