summaryrefslogtreecommitdiffstats
path: root/src/control/Script.cpp
diff options
context:
space:
mode:
authoreray orçunus <erayorcunus@gmail.com>2020-08-29 18:22:25 +0200
committereray orçunus <erayorcunus@gmail.com>2020-08-30 11:40:30 +0200
commit3e549a7d4484340d8d71500a7e61f81f403f48cc (patch)
tree3506aaab712cf59e5a0e687090ac7ebedd866c6b /src/control/Script.cpp
parentupdate librw (diff)
downloadre3-3e549a7d4484340d8d71500a7e61f81f403f48cc.tar
re3-3e549a7d4484340d8d71500a7e61f81f403f48cc.tar.gz
re3-3e549a7d4484340d8d71500a7e61f81f403f48cc.tar.bz2
re3-3e549a7d4484340d8d71500a7e61f81f403f48cc.tar.lz
re3-3e549a7d4484340d8d71500a7e61f81f403f48cc.tar.xz
re3-3e549a7d4484340d8d71500a7e61f81f403f48cc.tar.zst
re3-3e549a7d4484340d8d71500a7e61f81f403f48cc.zip
Diffstat (limited to '')
-rw-r--r--src/control/Script.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/control/Script.cpp b/src/control/Script.cpp
index bf761a3f..0921d1c6 100644
--- a/src/control/Script.cpp
+++ b/src/control/Script.cpp
@@ -1698,11 +1698,11 @@ void CMissionCleanup::AddEntityToList(int32 id, uint8 type)
m_nCount++;
}
-static void PossiblyWakeThisEntity(CPhysical* pEntity)
+static void PossiblyWakeThisEntity(CPhysical* pEntity, bool ifColLoaded = false)
{
if (!pEntity->bIsStaticWaitingForCollision)
return;
- if (CColStore::HasCollisionLoaded(pEntity->GetPosition())) {
+ if (!ifColLoaded || CColStore::HasCollisionLoaded(pEntity->GetPosition())) {
pEntity->bIsStaticWaitingForCollision = false;
if (!pEntity->IsStatic())
pEntity->AddToMovingList();
@@ -1745,7 +1745,7 @@ void CMissionCleanup::RemoveEntityFromList(int32 id, uint8 type)
}
}
-void CMissionCleanup::CheckIfCollisionHasLoadedForMissionObject()
+void CMissionCleanup::CheckIfCollisionHasLoadedForMissionObjects()
{
for (int i = 0; i < MAX_CLEANUP; i++) {
switch (m_sEntities[i].type) {
@@ -1753,21 +1753,21 @@ void CMissionCleanup::CheckIfCollisionHasLoadedForMissionObject()
{
CVehicle* v = CPools::GetVehiclePool()->GetAt(m_sEntities[i].id);
if (v)
- PossiblyWakeThisEntity(v);
+ PossiblyWakeThisEntity(v, true);
break;
}
case CLEANUP_CHAR:
{
CPed* p = CPools::GetPedPool()->GetAt(m_sEntities[i].id);
if (p)
- PossiblyWakeThisEntity(p);
+ PossiblyWakeThisEntity(p, true);
break;
}
case CLEANUP_OBJECT:
{
CObject* o = CPools::GetObjectPool()->GetAt(m_sEntities[i].id);
if (o)
- PossiblyWakeThisEntity(o);
+ PossiblyWakeThisEntity(o, true);
break;
}
default:
@@ -2350,7 +2350,7 @@ void CTheScripts::Process()
float timeStep = CTimer::GetTimeStepInMilliseconds();
UpsideDownCars.UpdateTimers();
StuckCars.Process();
- MissionCleanup.CheckIfCollisionHasLoadedForMissionObject();
+ MissionCleanup.CheckIfCollisionHasLoadedForMissionObjects();
DrawScriptSpheres();
if (FailCurrentMission)
--FailCurrentMission;