script revision

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

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