summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authoraap <aap@papnet.eu>2020-12-08 23:16:38 +0100
committeraap <aap@papnet.eu>2020-12-08 23:16:38 +0100
commitc8b0f0bdf8a29b8efbf5c0d1b6fd00cbb2e4b02f (patch)
tree17bb3b85fcfb7b234bb51e5b48f771bdced1a296 /src
parentUpdate Readme (diff)
downloadre3-c8b0f0bdf8a29b8efbf5c0d1b6fd00cbb2e4b02f.tar
re3-c8b0f0bdf8a29b8efbf5c0d1b6fd00cbb2e4b02f.tar.gz
re3-c8b0f0bdf8a29b8efbf5c0d1b6fd00cbb2e4b02f.tar.bz2
re3-c8b0f0bdf8a29b8efbf5c0d1b6fd00cbb2e4b02f.tar.lz
re3-c8b0f0bdf8a29b8efbf5c0d1b6fd00cbb2e4b02f.tar.xz
re3-c8b0f0bdf8a29b8efbf5c0d1b6fd00cbb2e4b02f.tar.zst
re3-c8b0f0bdf8a29b8efbf5c0d1b6fd00cbb2e4b02f.zip
Diffstat (limited to '')
-rw-r--r--src/objects/Object.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/objects/Object.cpp b/src/objects/Object.cpp
index 21aeb1e4..16483cca 100644
--- a/src/objects/Object.cpp
+++ b/src/objects/Object.cpp
@@ -813,8 +813,7 @@ CObject::DeleteAllTempObjectsInArea(CVector point, float fRadius)
CObjectPool *objectPool = CPools::GetObjectPool();
for (int32 i = 0; i < objectPool->GetSize(); i++) {
CObject *pObject = objectPool->GetSlot(i);
- CVector dist = point - pObject->GetPosition();
- if (pObject && pObject->ObjectCreatedBy == TEMP_OBJECT && dist.MagnitudeSqr() < fRadius * fRadius) {
+ if (pObject && pObject->ObjectCreatedBy == TEMP_OBJECT && (point - pObject->GetPosition()).MagnitudeSqr() < SQR(fRadius)) {
CWorld::Remove(pObject);
delete pObject;
}