summaryrefslogtreecommitdiffstats
path: root/src/core
diff options
context:
space:
mode:
Diffstat (limited to 'src/core')
-rw-r--r--src/core/ColStore.cpp11
-rw-r--r--src/core/World.cpp14
2 files changed, 16 insertions, 9 deletions
diff --git a/src/core/ColStore.cpp b/src/core/ColStore.cpp
index 0715ae6e..feaf08c7 100644
--- a/src/core/ColStore.cpp
+++ b/src/core/ColStore.cpp
@@ -9,6 +9,7 @@
#include "Timer.h"
#include "Camera.h"
#include "Frontend.h"
+#include "Physical.h"
#include "ColStore.h"
CPool<ColDef,ColDef> *CColStore::ms_pColPool;
@@ -174,7 +175,13 @@ CColStore::LoadCollision(const CVector2D &pos)
CGeneral::faststrcmp(GetColName(i), "yacht") == 0){
wantThisOne = true;
}else{
- // TODO: check mission cleanup list
+ for (int j = 0; j < MAX_CLEANUP; j++) {
+ CPhysical* pEntity = CTheScripts::MissionCleanup.DoesThisEntityWaitForCollision(j);
+ if (pEntity /* !pEntity->bDontLoadCollision && !pEntity->bIsFrozen */) {
+ if (GetBoundingBox(i).IsPointInside(pEntity->GetPosition(), -80.0f))
+ wantThisOne = true;
+ }
+ }
}
if(wantThisOne)
@@ -221,7 +228,7 @@ CColStore::HasCollisionLoaded(const CVector2D &pos)
int i;
for(i = 1; i < COLSTORESIZE; i++)
- if(GetSlot(i) && GetBoundingBox(i).IsPointInside(pos, -110.0f) &&
+ if(GetSlot(i) && GetBoundingBox(i).IsPointInside(pos, -115.0f) &&
!GetSlot(i)->isLoaded)
return false;
return true;
diff --git a/src/core/World.cpp b/src/core/World.cpp
index 09170f54..625ccf57 100644
--- a/src/core/World.cpp
+++ b/src/core/World.cpp
@@ -75,7 +75,7 @@ CWorld::Add(CEntity *ent)
if(ent->IsBuilding() || ent->IsDummy()) return;
- if(!ent->bIsStatic) ((CPhysical *)ent)->AddToMovingList();
+ if(!ent->IsStatic()) ((CPhysical *)ent)->AddToMovingList();
}
void
@@ -90,7 +90,7 @@ CWorld::Remove(CEntity *ent)
if(ent->IsBuilding() || ent->IsDummy()) return;
- if(!ent->bIsStatic) ((CPhysical *)ent)->RemoveFromMovingList();
+ if(!ent->IsStatic()) ((CPhysical *)ent)->RemoveFromMovingList();
}
void
@@ -1951,7 +1951,7 @@ CWorld::Process(void)
RemoveEntityInsteadOfProcessingIt(movingEnt);
} else {
movingEnt->ProcessControl();
- if(movingEnt->bIsStatic) { movingEnt->RemoveFromMovingList(); }
+ if(movingEnt->IsStatic()) { movingEnt->RemoveFromMovingList(); }
}
}
bForceProcessControl = true;
@@ -1962,7 +1962,7 @@ CWorld::Process(void)
RemoveEntityInsteadOfProcessingIt(movingEnt);
} else {
movingEnt->ProcessControl();
- if(movingEnt->bIsStatic) { movingEnt->RemoveFromMovingList(); }
+ if(movingEnt->IsStatic()) { movingEnt->RemoveFromMovingList(); }
}
}
}
@@ -2115,7 +2115,7 @@ CWorld::TriggerExplosionSectorList(CPtrList &list, const CVector &position, floa
CObject *pObject = (CObject *)pEntity;
CVehicle *pVehicle = (CVehicle *)pEntity;
if(!pEntity->bExplosionProof && (!pEntity->IsPed() || !pPed->bInVehicle)) {
- if(pEntity->bIsStatic) {
+ if(pEntity->IsStatic()) {
if(pEntity->IsObject()) {
if (fPower > pObject->m_fUprootLimit || IsFence(pObject->GetModelIndex())) {
if (IsGlass(pObject->GetModelIndex())) {
@@ -2139,7 +2139,7 @@ CWorld::TriggerExplosionSectorList(CPtrList &list, const CVector &position, floa
}
}
}
- if(pEntity->bIsStatic) {
+ if(pEntity->IsStatic()) {
float fDamageMultiplier =
(fRadius - fMagnitude) * 2.0f / fRadius;
float fDamage = 300.0f * Min(fDamageMultiplier, 1.0f);
@@ -2150,7 +2150,7 @@ CWorld::TriggerExplosionSectorList(CPtrList &list, const CVector &position, floa
pEntity->AddToMovingList();
}
}
- if(!pEntity->bIsStatic) {
+ if(!pEntity->IsStatic()) {
float fDamageMultiplier = Min((fRadius - fMagnitude) * 2.0f / fRadius, 1.0f);
CVector vecForceDir =
vecDistance * (fPower * pEntity->m_fMass * 0.00071429f * fDamageMultiplier /