From db1bdfd62d5d0eb663f9844845de98fdbc0acd02 Mon Sep 17 00:00:00 2001 From: Nikolay Korolev Date: Thu, 7 Jan 2021 16:33:42 +0300 Subject: minor refactoring --- src/collision/ColStore.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'src/collision') diff --git a/src/collision/ColStore.cpp b/src/collision/ColStore.cpp index 4317655a..f1e695fe 100644 --- a/src/collision/ColStore.cpp +++ b/src/collision/ColStore.cpp @@ -12,6 +12,7 @@ #include "Physical.h" #include "ColStore.h" #include "VarConsole.h" +#include "Pools.h" CPool *CColStore::ms_pColPool; #ifndef MASTER @@ -184,7 +185,18 @@ CColStore::LoadCollision(const CVector2D &pos) wantThisOne = true; }else{ for (int j = 0; j < MAX_CLEANUP; j++) { - CPhysical* pEntity = CTheScripts::MissionCleanup.DoesThisEntityWaitForCollision(j); + CPhysical* pEntity = nil; + cleanup_entity_struct* pCleanup = &CTheScripts::MissionCleanUp.m_sEntities[i]; + if (pCleanup->type == CLEANUP_CAR) { + pEntity = CPools::GetVehiclePool()->GetAt(pCleanup->id); + if (!pEntity || pEntity->GetStatus() == STATUS_WRECKED) + continue; + } + else if (pCleanup->type == CLEANUP_CHAR) { + pEntity = CPools::GetPedPool()->GetAt(pCleanup->id); + if (!pEntity || ((CPed*)pEntity)->DyingOrDead()) + continue; + } if (pEntity && !pEntity->bDontLoadCollision && !pEntity->bIsFrozen) { if (GetBoundingBox(i).IsPointInside(pEntity->GetPosition(), -80.0f)) wantThisOne = true; -- cgit v1.2.3