From 03ef438a7283fde341cc4938936ba882c3609993 Mon Sep 17 00:00:00 2001 From: "Walied K. Yassen" Date: Sun, 29 Nov 2020 04:20:28 +0200 Subject: [PATCH] Fix CObject::DeleteAllTempObjectsInArea not considering the given point --- src/objects/Object.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/objects/Object.cpp b/src/objects/Object.cpp index 93b6d581..2319c0d9 100644 --- a/src/objects/Object.cpp +++ b/src/objects/Object.cpp @@ -515,7 +515,8 @@ CObject::DeleteAllTempObjectsInArea(CVector point, float fRadius) CObjectPool *objectPool = CPools::GetObjectPool(); for (int32 i = 0; i < objectPool->GetSize(); i++) { CObject *pObject = objectPool->GetSlot(i); - if (pObject && pObject->ObjectCreatedBy == TEMP_OBJECT && fRadius * fRadius > pObject->GetPosition().MagnitudeSqr()) { + CVector dist = point - pObject->GetPosition(); + if (pObject && pObject->ObjectCreatedBy == TEMP_OBJECT && dist.MagnitudeSqr() < fRadius * fRadius) { CWorld::Remove(pObject); delete pObject; }