diff options
author | erorcun <erayorcunus@gmail.com> | 2020-08-30 22:24:39 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-30 22:24:39 +0200 |
commit | b7456c604db963cd7ec065b896d23640d5713167 (patch) | |
tree | 190857b8b0db08b78a17fb5bdfaefa29768834aa /src/control/Script.cpp | |
parent | stupid zone load fix (diff) | |
parent | CGame done, Peds, fixes (diff) | |
download | re3-b7456c604db963cd7ec065b896d23640d5713167.tar re3-b7456c604db963cd7ec065b896d23640d5713167.tar.gz re3-b7456c604db963cd7ec065b896d23640d5713167.tar.bz2 re3-b7456c604db963cd7ec065b896d23640d5713167.tar.lz re3-b7456c604db963cd7ec065b896d23640d5713167.tar.xz re3-b7456c604db963cd7ec065b896d23640d5713167.tar.zst re3-b7456c604db963cd7ec065b896d23640d5713167.zip |
Diffstat (limited to 'src/control/Script.cpp')
-rw-r--r-- | src/control/Script.cpp | 14 |
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; |