summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-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;
}