summaryrefslogtreecommitdiffstats
path: root/src/objects/Object.cpp
diff options
context:
space:
mode:
authorWalied K. Yassen <walied.developer@hotmail.com>2020-11-29 03:20:28 +0100
committerWalied K. Yassen <walied.developer@hotmail.com>2020-11-29 03:20:28 +0100
commit03ef438a7283fde341cc4938936ba882c3609993 (patch)
tree5ed4aaff0ce612ff2871e167cb4a237063b2256a /src/objects/Object.cpp
parentsome nasty FIX_BUGS for SLIDE_OBJECT (diff)
downloadre3-03ef438a7283fde341cc4938936ba882c3609993.tar
re3-03ef438a7283fde341cc4938936ba882c3609993.tar.gz
re3-03ef438a7283fde341cc4938936ba882c3609993.tar.bz2
re3-03ef438a7283fde341cc4938936ba882c3609993.tar.lz
re3-03ef438a7283fde341cc4938936ba882c3609993.tar.xz
re3-03ef438a7283fde341cc4938936ba882c3609993.tar.zst
re3-03ef438a7283fde341cc4938936ba882c3609993.zip
Diffstat (limited to 'src/objects/Object.cpp')
-rw-r--r--src/objects/Object.cpp3
1 files changed, 2 insertions, 1 deletions
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;
}