summaryrefslogtreecommitdiff
path: root/src/objects
diff options
context:
space:
mode:
authoraap <aap@papnet.eu>2020-12-08 23:15:59 +0100
committeraap <aap@papnet.eu>2020-12-08 23:15:59 +0100
commitf6cc178a502b276128d52ed976e8dbe53875da8a (patch)
tree6930d35cb036c55b474cc2cc0a13d597df4e9322 /src/objects
parenteaf32190ca0a31e5edd94ce3d2842085674cf706 (diff)
fix CObject::DeleteAllTempObjectsInArea
Diffstat (limited to 'src/objects')
-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 466cecac..411e245a 100644
--- a/src/objects/Object.cpp
+++ b/src/objects/Object.cpp
@@ -389,8 +389,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;
}