summaryrefslogtreecommitdiffstats
path: root/src/core/templates.h
diff options
context:
space:
mode:
authorerorcun <erorcunerorcun@hotmail.com.tr>2020-12-16 21:28:25 +0100
committererorcun <erorcunerorcun@hotmail.com.tr>2020-12-16 21:28:25 +0100
commit12d16ddc063bc442c9366aff189f67827aeb09af (patch)
tree03f4872d235109bcdd66c660c57a3ec883192dc1 /src/core/templates.h
parentupdate librw with stencil states (diff)
downloadre3-12d16ddc063bc442c9366aff189f67827aeb09af.tar
re3-12d16ddc063bc442c9366aff189f67827aeb09af.tar.gz
re3-12d16ddc063bc442c9366aff189f67827aeb09af.tar.bz2
re3-12d16ddc063bc442c9366aff189f67827aeb09af.tar.lz
re3-12d16ddc063bc442c9366aff189f67827aeb09af.tar.xz
re3-12d16ddc063bc442c9366aff189f67827aeb09af.tar.zst
re3-12d16ddc063bc442c9366aff189f67827aeb09af.zip
Diffstat (limited to 'src/core/templates.h')
-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 {