summaryrefslogtreecommitdiffstats
path: root/src/core/templates.h
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/core/templates.h3
1 files changed, 2 insertions, 1 deletions
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 {