Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
fix CObject::DeleteAllTempObjectsInArea
- Loading branch information
Showing
with
1 addition
and
2 deletions.
-
+1
−2
src/objects/Object.cpp
There are no files selected for viewing
|
|
@@ -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; |
|
|
} |
|
|
|