script revision

This commit is contained in:
Nikolay Korolev committed 2020-05-19 01:49:09 +03:00
1 parent 68f1c03a85
commit 6510b15704
15 files changed
+236 -123

No files matched your search

+15
View File
@@ -396,3 +396,18 @@ CObject::DeleteAllTempObjectsInArea(CVector point, float fRadius)
}
}
}
bool
IsObjectPointerValid(CObject* pObject)
{
if (!pObject)
return false;
int index = CPools::GetObjectPool()->GetJustIndex(pObject);
#ifdef FIX_BUGS
if (index < 0 || index >= CPools::GetObjectPool()->GetSize())
#else
if (index < 0 || index > CPools::GetObjectPool()->GetSize())
#endif
return false;
return pObject->bIsBIGBuilding || pObject->m_entryInfoList.first;
}
+2
View File
@@ -113,3 +113,5 @@ public:
static void DeleteAllTempObjects();
static void DeleteAllTempObjectsInArea(CVector point, float fRadius);
};
bool IsObjectPointerValid(CObject* pObject);