summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJonathan Bradley <jcb@pikum.xyz>2025-05-22 11:23:28 -0400
committerJonathan Bradley <jcb@pikum.xyz>2025-05-22 11:23:28 -0400
commitc4260eeea46d19b0b7a6eb4ca491425057bd361f (patch)
treec20229dea1d78b93aa12d93ae8a51f15632bb765 /src
parent21ef5a2e2a6ec2b3b8a282b77fb0a82f6aa277de (diff)
pke: serialization get base entity over searching
Diffstat (limited to 'src')
-rw-r--r--src/serialization-component.cpp18
1 files changed, 17 insertions, 1 deletions
diff --git a/src/serialization-component.cpp b/src/serialization-component.cpp
index 63e7a5c..34d4708 100644
--- a/src/serialization-component.cpp
+++ b/src/serialization-component.cpp
@@ -150,9 +150,25 @@ pk_handle pke_serialize_instance(srlztn_serialize_helper *h, const CompInstance
pk_arr_append_t(&kvec.child_handles, inst_pos_handle);
if (comp->grBindsHandle != GrBindsHandle_MAX) {
- et = EntityType_FindByEntityHandle(ECS_GetGrBinds(comp->grBindsHandle)->entHandle);
+ et = static_cast<EntityType *>(ECS_GetEntity(ECS_GetGrBinds(comp->grBindsHandle)->entHandle));
}
+ /* JCB - 2025-05-22
+ * uncomment for debugging
+ if (et == nullptr) {
+ EntityHandle ent_type_ent_handle = ECS_GetGrBinds(comp->grBindsHandle)->entHandle;
+ Entity_Base *ent_type_ent = ECS_GetEntity(ent_type_ent_handle);
+ fprintf(stderr, "[" __FILE__ "] WARNING: Failed to find EntityType. "
+ "GrBinds Handle: '%.8X:%.8X' "
+ "GrBinds EntHandle: '%.8X:%.8X'"
+ "GrBinds entity_ptr: '%p'\n"
+ ,comp->grBindsHandle.bucketIndex, comp->grBindsHandle.itemIndex
+ ,ent_type_ent_handle.bucketIndex, ent_type_ent_handle.itemIndex
+ ,(void *)ent_type_ent
+ );
+ }
+ */
+
if (comp->uuid != pk_uuid_zed && comp->uuid != pk_uuid_max) {
kve.key = SRLZTN_INSTANCE_COMPONENT_UUID;
s = pk_new<char>(37, h->bkt);