diff options
| -rw-r--r-- | src/serialization-component.cpp | 18 |
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); |
