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

View File

@ -113,3 +113,5 @@ public:
static void DeleteAllTempObjects();
static void DeleteAllTempObjectsInArea(CVector point, float fRadius);
};
bool IsObjectPointerValid(CObject* pObject);