Fix CObject::DeleteAllTempObjectsInArea not considering the given point

This commit is contained in:
Walied K. Yassen 2020-11-29 04:20:28 +02:00
parent 8cb3c07151
commit 03ef438a72
No known key found for this signature in database
GPG key ID: 310BA64A98BBFB41

View file

@ -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;
}