summaryrefslogtreecommitdiffstats
path: root/src/objects/Object.cpp
diff options
context:
space:
mode:
authoraap <aap@papnet.eu>2020-05-19 13:26:21 +0200
committerGitHub <noreply@github.com>2020-05-19 13:26:21 +0200
commit6b0b984909fe7ff268e978938e65a91d9bfd7d8c (patch)
tree71bf0f31ca1922c89b7996effe6ca87ef4c3a749 /src/objects/Object.cpp
parentHandlingMgr (diff)
parentMerge remote-tracking branch 'upstream/miami' into miami (diff)
downloadre3-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.cpp15
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;
+}