summaryrefslogtreecommitdiffstats
path: root/src/peds/Population.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/peds/Population.cpp')
-rw-r--r--src/peds/Population.cpp15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/peds/Population.cpp b/src/peds/Population.cpp
index 3d4746d2..6a41b0c1 100644
--- a/src/peds/Population.cpp
+++ b/src/peds/Population.cpp
@@ -979,27 +979,30 @@ CPopulation::TestSafeForRealObject(CDummyObject *dummy)
{
CPtrNode *ptrNode;
CColModel *dummyCol = dummy->GetColModel();
- float colRadius = dummy->GetBoundRadius();
- CVector colCentre = dummy->GetBoundCentre();
- int minX = CWorld::GetSectorIndexX(dummy->GetPosition().x - colRadius);
+ float radius = dummyCol->boundingSphere.radius;
+ int minX = CWorld::GetSectorIndexX(dummy->GetPosition().x - radius);
if (minX < 0) minX = 0;
- int minY = CWorld::GetSectorIndexY(dummy->GetPosition().y - colRadius);
+ int minY = CWorld::GetSectorIndexY(dummy->GetPosition().y - radius);
if (minY < 0) minY = 0;
- int maxX = CWorld::GetSectorIndexX(dummy->GetPosition().x + colRadius);
+ int maxX = CWorld::GetSectorIndexX(dummy->GetPosition().x + radius);
#ifdef FIX_BUGS
if (maxX >= NUMSECTORS_X) maxX = NUMSECTORS_X - 1;
#else
if (maxX >= NUMSECTORS_X) maxX = NUMSECTORS_X;
#endif
- int maxY = CWorld::GetSectorIndexY(dummy->GetPosition().y + colRadius);
+ int maxY = CWorld::GetSectorIndexY(dummy->GetPosition().y + radius);
#ifdef FIX_BUGS
if (maxY >= NUMSECTORS_Y) maxY = NUMSECTORS_Y - 1;
#else
if (maxY >= NUMSECTORS_Y) maxY = NUMSECTORS_Y;
#endif
+ float colRadius = dummy->GetBoundRadius();
+ CVUVECTOR colCentre;
+ dummy->GetBoundCentre(colCentre);
+
static CColPoint aTempColPoints[MAX_COLLISION_POINTS];
for (int curY = minY; curY <= maxY; curY++) {