diff options
| author | Jonathan Bradley <jcb@pikum.xyz> | 2025-05-29 16:11:37 -0400 |
|---|---|---|
| committer | Jonathan Bradley <jcb@pikum.xyz> | 2025-05-29 16:11:37 -0400 |
| commit | d9dc3559296661249f9e5f1c3d0a8320cbf8fc29 (patch) | |
| tree | 2a0203b676f15e8933960e786c8181354f73b121 /src/serialization-component.cpp | |
| parent | a9bc23377bd9193cd3eb3ef2e91431d088d13d5d (diff) | |
pke: ecs: BucketContainer > pk_bkt_arr_t & cleanup
Diffstat (limited to 'src/serialization-component.cpp')
| -rw-r--r-- | src/serialization-component.cpp | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/src/serialization-component.cpp b/src/serialization-component.cpp index dac8d35..df6d633 100644 --- a/src/serialization-component.cpp +++ b/src/serialization-component.cpp @@ -260,21 +260,27 @@ void pke_deserialize_instance(srlztn_deserialize_helper *h, pke_kve_container *k if (strstr(kvec->arr[i].key, SRLZTN_INSTANCE_COMPONENT_MASS)) { stn_res = pk_stn(&mass, kvec->arr[i].val, nullptr); if (stn_res != PK_STN_RES_SUCCESS) { - fprintf(stderr, "[pke_deserialize_instance] Failed to parse %s\n", SRLZTN_INSTANCE_COMPONENT_MASS); + fprintf(stderr, "[pke_deserialize_instance] Failed to parse %s, %i\n", SRLZTN_INSTANCE_COMPONENT_MASS, stn_res); } continue; } if (strstr(kvec->arr[i].key, SRLZTN_INSTANCE_COMPONENT_COLLISION_LAYER)) { - stn_res = pk_stn(&comp.physicsLayer, kvec->arr[i].val, nullptr, 10); + PhysicsCollision_T layer; + stn_res = pk_stn(&layer, kvec->arr[i].val, nullptr, 10); if (stn_res != PK_STN_RES_SUCCESS) { - fprintf(stderr, "[pke_deserialize_instance] Failed to parse %s\n", SRLZTN_INSTANCE_COMPONENT_COLLISION_LAYER); + fprintf(stderr, "[pke_deserialize_instance] Failed to parse %s, %i\n", SRLZTN_INSTANCE_COMPONENT_COLLISION_LAYER, stn_res); + } else { + comp.physicsLayer = PhysicsCollision{layer}; } continue; } if (strstr(kvec->arr[i].key, SRLZTN_INSTANCE_COMPONENT_COLLISION_MASK)) { - stn_res = pk_stn(&comp.physicsMask, kvec->arr[i].val, nullptr, 10); + PhysicsCollision_T mask; + stn_res = pk_stn(&mask, kvec->arr[i].val, nullptr, 10); if (stn_res != PK_STN_RES_SUCCESS) { - fprintf(stderr, "[pke_deserialize_instance] Failed to parse %s\n", SRLZTN_INSTANCE_COMPONENT_COLLISION_MASK); + fprintf(stderr, "[pke_deserialize_instance] Failed to parse %s, %i\n", SRLZTN_INSTANCE_COMPONENT_COLLISION_MASK, stn_res); + } else { + comp.physicsMask = PhysicsCollision{mask}; } continue; } @@ -284,7 +290,7 @@ void pke_deserialize_instance(srlztn_deserialize_helper *h, pke_kve_container *k } } if (et_ptr == nullptr) { - fprintf(stdout, "[Game::DeserializeInstance] Unknown EntityTypeCode, skipping instance.\n"); + fprintf(stdout, "[pke_deserialize_instance] Unknown EntityTypeCode, skipping instance.\n"); } btVector3 bt_pos; btQuaternion bt_quat; |
