diff options
author | aap <aap@papnet.eu> | 2020-05-19 13:26:21 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-19 13:26:21 +0200 |
commit | 6b0b984909fe7ff268e978938e65a91d9bfd7d8c (patch) | |
tree | 71bf0f31ca1922c89b7996effe6ca87ef4c3a749 /src/objects/Object.cpp | |
parent | HandlingMgr (diff) | |
parent | Merge remote-tracking branch 'upstream/miami' into miami (diff) | |
download | re3-6b0b984909fe7ff268e978938e65a91d9bfd7d8c.tar re3-6b0b984909fe7ff268e978938e65a91d9bfd7d8c.tar.gz re3-6b0b984909fe7ff268e978938e65a91d9bfd7d8c.tar.bz2 re3-6b0b984909fe7ff268e978938e65a91d9bfd7d8c.tar.lz re3-6b0b984909fe7ff268e978938e65a91d9bfd7d8c.tar.xz re3-6b0b984909fe7ff268e978938e65a91d9bfd7d8c.tar.zst re3-6b0b984909fe7ff268e978938e65a91d9bfd7d8c.zip |
Diffstat (limited to '')
-rw-r--r-- | src/objects/Object.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/objects/Object.cpp b/src/objects/Object.cpp index 0107c75c..4a45050c 100644 --- a/src/objects/Object.cpp +++ b/src/objects/Object.cpp @@ -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; +} |