diff options
author | Nikolay Korolev <nickvnuk@gmail.com> | 2021-01-07 16:38:40 +0100 |
---|---|---|
committer | Nikolay Korolev <nickvnuk@gmail.com> | 2021-01-07 16:38:40 +0100 |
commit | 5e10f1fe6ae08fe1b6ec2f52f8d097d54c4b8ab3 (patch) | |
tree | 435e3b7d8d0c9b0a8e75bd97a34bbf446c0d9730 /src/collision | |
parent | some lcs stuff (diff) | |
parent | fail (diff) | |
download | re3-5e10f1fe6ae08fe1b6ec2f52f8d097d54c4b8ab3.tar re3-5e10f1fe6ae08fe1b6ec2f52f8d097d54c4b8ab3.tar.gz re3-5e10f1fe6ae08fe1b6ec2f52f8d097d54c4b8ab3.tar.bz2 re3-5e10f1fe6ae08fe1b6ec2f52f8d097d54c4b8ab3.tar.lz re3-5e10f1fe6ae08fe1b6ec2f52f8d097d54c4b8ab3.tar.xz re3-5e10f1fe6ae08fe1b6ec2f52f8d097d54c4b8ab3.tar.zst re3-5e10f1fe6ae08fe1b6ec2f52f8d097d54c4b8ab3.zip |
Diffstat (limited to 'src/collision')
-rw-r--r-- | src/collision/ColStore.cpp | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/src/collision/ColStore.cpp b/src/collision/ColStore.cpp index 192c373d..f1e695fe 100644 --- a/src/collision/ColStore.cpp +++ b/src/collision/ColStore.cpp @@ -11,8 +11,13 @@ #include "Frontend.h" #include "Physical.h" #include "ColStore.h" +#include "VarConsole.h" +#include "Pools.h" CPool<ColDef,ColDef> *CColStore::ms_pColPool; +#ifndef MASTER +bool bDispColInMem; +#endif void CColStore::Initialise(void) @@ -20,6 +25,9 @@ CColStore::Initialise(void) if(ms_pColPool == nil) ms_pColPool = new CPool<ColDef,ColDef>(COLSTORESIZE, "CollisionFiles"); AddColSlot("generic"); // slot 0. not streamed +#ifndef MASTER + VarConsole.Add("Display collision in memory", &bDispColInMem, true); +#endif } void @@ -177,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; |