summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNikolay Korolev <nickvnuk@gmail.com>2020-04-24 00:40:12 +0200
committerNikolay Korolev <nickvnuk@gmail.com>2020-04-24 00:40:12 +0200
commitbed41e1bec7969535099b8aaaf035288c12e7bfb (patch)
tree74506219b8a9f6877546ca0ac1571c61b17bce4f
parentfix annoying bug (diff)
downloadre3-bed41e1bec7969535099b8aaaf035288c12e7bfb.tar
re3-bed41e1bec7969535099b8aaaf035288c12e7bfb.tar.gz
re3-bed41e1bec7969535099b8aaaf035288c12e7bfb.tar.bz2
re3-bed41e1bec7969535099b8aaaf035288c12e7bfb.tar.lz
re3-bed41e1bec7969535099b8aaaf035288c12e7bfb.tar.xz
re3-bed41e1bec7969535099b8aaaf035288c12e7bfb.tar.zst
re3-bed41e1bec7969535099b8aaaf035288c12e7bfb.zip
Diffstat (limited to '')
-rw-r--r--src/control/Script.cpp50
1 files changed, 18 insertions, 32 deletions
diff --git a/src/control/Script.cpp b/src/control/Script.cpp
index 0445922a..a4ad15a9 100644
--- a/src/control/Script.cpp
+++ b/src/control/Script.cpp
@@ -256,10 +256,6 @@ void CUpsideDownCarCheck::UpdateTimers()
{
uint32 timeStep = CTimer::GetTimeStepInMilliseconds();
for (int i = 0; i < MAX_UPSIDEDOWN_CAR_CHECKS; i++){
-#ifdef FIX_BUGS
- if (m_sCars[i].m_nVehicleIndex == -1)
- continue;
-#endif
CVehicle* v = CPools::GetVehiclePool()->GetAt(m_sCars[i].m_nVehicleIndex);
if (v){
if (IsCarUpsideDown(m_sCars[i].m_nVehicleIndex))
@@ -2308,20 +2304,15 @@ int8 CRunningScript::ProcessCommands200To299(int32 command)
assert(pCurrent); // GetIndex(0) doesn't look good
int handle = CPools::GetVehiclePool()->GetIndex(pCurrent);
if (handle != CTheScripts::StoreVehicleIndex && m_bIsMissionScript){
-#ifdef FIX_BUGS
- if (CTheScripts::StoreVehicleIndex != -1)
-#endif
- {
- CVehicle* pOld = CPools::GetVehiclePool()->GetAt(CTheScripts::StoreVehicleIndex);
- if (pOld){
- CCarCtrl::RemoveFromInterestingVehicleList(pOld);
- if (pOld->VehicleCreatedBy == MISSION_VEHICLE && CTheScripts::StoreVehicleWasRandom){
- pOld->VehicleCreatedBy = RANDOM_VEHICLE;
- pOld->bIsLocked = false;
- CCarCtrl::NumRandomCars++;
- CCarCtrl::NumMissionCars--;
- CTheScripts::MissionCleanup.RemoveEntityFromList(CTheScripts::StoreVehicleIndex, CLEANUP_CAR);
- }
+ CVehicle* pOld = CPools::GetVehiclePool()->GetAt(CTheScripts::StoreVehicleIndex);
+ if (pOld){
+ CCarCtrl::RemoveFromInterestingVehicleList(pOld);
+ if (pOld->VehicleCreatedBy == MISSION_VEHICLE && CTheScripts::StoreVehicleWasRandom){
+ pOld->VehicleCreatedBy = RANDOM_VEHICLE;
+ pOld->bIsLocked = false;
+ CCarCtrl::NumRandomCars++;
+ CCarCtrl::NumMissionCars--;
+ CTheScripts::MissionCleanup.RemoveEntityFromList(CTheScripts::StoreVehicleIndex, CLEANUP_CAR);
}
}
@@ -2364,20 +2355,15 @@ int8 CRunningScript::ProcessCommands200To299(int32 command)
assert(pCurrent); // Here pCurrent shouldn't be NULL anyway
int handle = CPools::GetVehiclePool()->GetIndex(pCurrent);
if (handle != CTheScripts::StoreVehicleIndex && m_bIsMissionScript) {
-#ifdef FIX_BUGS
- if (CTheScripts::StoreVehicleIndex != -1)
-#endif
- {
- CVehicle* pOld = CPools::GetVehiclePool()->GetAt(CTheScripts::StoreVehicleIndex);
- if (pOld){
- CCarCtrl::RemoveFromInterestingVehicleList(pOld);
- if (pOld->VehicleCreatedBy == MISSION_VEHICLE && CTheScripts::StoreVehicleWasRandom){
- pOld->VehicleCreatedBy = RANDOM_VEHICLE;
- pOld->bIsLocked = false;
- CCarCtrl::NumRandomCars++;
- CCarCtrl::NumMissionCars--;
- CTheScripts::MissionCleanup.RemoveEntityFromList(CTheScripts::StoreVehicleIndex, CLEANUP_CAR);
- }
+ CVehicle* pOld = CPools::GetVehiclePool()->GetAt(CTheScripts::StoreVehicleIndex);
+ if (pOld){
+ CCarCtrl::RemoveFromInterestingVehicleList(pOld);
+ if (pOld->VehicleCreatedBy == MISSION_VEHICLE && CTheScripts::StoreVehicleWasRandom){
+ pOld->VehicleCreatedBy = RANDOM_VEHICLE;
+ pOld->bIsLocked = false;
+ CCarCtrl::NumRandomCars++;
+ CCarCtrl::NumMissionCars--;
+ CTheScripts::MissionCleanup.RemoveEntityFromList(CTheScripts::StoreVehicleIndex, CLEANUP_CAR);
}
}