diff options
Diffstat (limited to 'src/entities/Dummy.cpp')
-rw-r--r-- | src/entities/Dummy.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/entities/Dummy.cpp b/src/entities/Dummy.cpp index 8a4bfd5f..580245a8 100644 --- a/src/entities/Dummy.cpp +++ b/src/entities/Dummy.cpp @@ -4,6 +4,8 @@ #include "World.h" #include "Dummy.h" +// --MIAMI: file done + void *CDummy::operator new(size_t sz) { return CPools::GetDummyPool()->New(); } void CDummy::operator delete(void *p, size_t sz) { CPools::GetDummyPool()->Delete((CDummy*)p); } @@ -50,3 +52,18 @@ CDummy::Remove(void) m_entryInfoList.DeleteNode(node); } } + +bool +IsDummyPointerValid(CDummy* pDummy) +{ + if (!pDummy) + return false; + int index = CPools::GetDummyPool()->GetJustIndex_NoFreeAssert(pDummy); +#ifdef FIX_BUGS + if (index < 0 || index >= CPools::GetDummyPool()->GetSize()) +#else + if (index < 0 || index > CPools::GetDummyPool()->GetSize()) +#endif + return false; + return pDummy->m_entryInfoList.first; +} |