summaryrefslogtreecommitdiffstats
path: root/src/peds/Population.cpp
diff options
context:
space:
mode:
authoraap <aap@papnet.eu>2021-05-23 17:45:07 +0200
committerSergeanur <s.anureev@yandex.ua>2021-06-24 20:32:43 +0200
commit50058371efaf4c5713b7a608db0c7990ec3d78a6 (patch)
tree314722ae778432755c8ea0563a317df52fe130ee /src/peds/Population.cpp
parentUndef PS2_AUDIO_CHANNELS for SQUEEZE_PERFORMANCE and VANILLA_DEFINES (diff)
downloadre3-50058371efaf4c5713b7a608db0c7990ec3d78a6.tar
re3-50058371efaf4c5713b7a608db0c7990ec3d78a6.tar.gz
re3-50058371efaf4c5713b7a608db0c7990ec3d78a6.tar.bz2
re3-50058371efaf4c5713b7a608db0c7990ec3d78a6.tar.lz
re3-50058371efaf4c5713b7a608db0c7990ec3d78a6.tar.xz
re3-50058371efaf4c5713b7a608db0c7990ec3d78a6.tar.zst
re3-50058371efaf4c5713b7a608db0c7990ec3d78a6.zip
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 5bbb7c4b..906ee6e9 100644
--- a/src/peds/Population.cpp
+++ b/src/peds/Population.cpp
@@ -1011,27 +1011,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++) {