summaryrefslogtreecommitdiffstats
path: root/src/objects/Object.cpp
diff options
context:
space:
mode:
authoreray orçunus <erayorcunus@gmail.com>2020-05-19 16:46:18 +0200
committereray orçunus <erayorcunus@gmail.com>2020-05-19 16:46:18 +0200
commit99574ebfc61a79b34f4681eaa2debefbae174875 (patch)
treea3edae2913a4af9682f7ecfec53367a484c2975c /src/objects/Object.cpp
parentMelee weapons(half-working), Ped and Hud bits (diff)
parentMerge pull request #564 from Xinerki/miami (diff)
downloadre3-99574ebfc61a79b34f4681eaa2debefbae174875.tar
re3-99574ebfc61a79b34f4681eaa2debefbae174875.tar.gz
re3-99574ebfc61a79b34f4681eaa2debefbae174875.tar.bz2
re3-99574ebfc61a79b34f4681eaa2debefbae174875.tar.lz
re3-99574ebfc61a79b34f4681eaa2debefbae174875.tar.xz
re3-99574ebfc61a79b34f4681eaa2debefbae174875.tar.zst
re3-99574ebfc61a79b34f4681eaa2debefbae174875.zip
Diffstat (limited to 'src/objects/Object.cpp')
-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;
+}