From 12d16ddc063bc442c9366aff189f67827aeb09af Mon Sep 17 00:00:00 2001 From: erorcun Date: Wed, 16 Dec 2020 23:28:25 +0300 Subject: Fixes and style changes --- src/core/templates.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/core/templates.h') diff --git a/src/core/templates.h b/src/core/templates.h index bb89814e..43c8d8fc 100644 --- a/src/core/templates.h +++ b/src/core/templates.h @@ -129,12 +129,13 @@ public: } int GetJustIndex(T* entry) { int index = GetJustIndex_NoFreeAssert(entry); + assert((U*)entry == (U*)&m_entries[index]); // cast is unsafe - check required assert(!IsFreeSlot(index)); return index; } int GetJustIndex_NoFreeAssert(T* entry) { int index = ((U*)entry - m_entries); - assert((U*)entry == (U*)&m_entries[index]); // cast is unsafe - check required + // Please don't add unsafe assert here, because at least one func. use this to check if entity is ped or vehicle. return index; } int GetNoOfUsedSpaces(void) const { -- cgit v1.2.3