[core] Encapsulate entity preference creation to prepare for hash migration

This commit is contained in:
J. Nick Koston
2026-01-23 22:08:12 -10:00
parent dd98b6a3a7
commit 195301f9fc

View File

@@ -156,6 +156,7 @@ class EntityBase {
/// @tparam T The type of data to store (must be trivially copyable)
/// @param version Optional version hash XORed with preference key (change when struct layout changes)
template<typename T> ESPPreferenceObject make_entity_preference(uint32_t version = 0) {
static_assert(std::is_trivially_copyable<T>::value, "T must be trivially copyable");
return this->make_entity_preference_(sizeof(T), version);
}