Skip to content

Commit

Permalink
fix: fauly logic on index of get components (#154)
Browse files Browse the repository at this point in the history
  • Loading branch information
Kelwan authored Oct 29, 2024
1 parent afda94f commit 5b751ce
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions runtime/ecsact_rt_entt_core.cc
Original file line number Diff line number Diff line change
Expand Up @@ -176,14 +176,12 @@ void ecsact_get_components(

auto index = 0;
for(auto comp_id : all_component_ids) {
if(index >= max_components_count) {
break;
}

if(ecsact_has_component(registry_id, entity_id, comp_id, nullptr)) {
out_component_ids[index] = comp_id;
out_components_data[index] =
ecsact_get_component(registry_id, entity_id, comp_id, nullptr);
if(index < max_components_count) {
out_component_ids[index] = comp_id;
out_components_data[index] =
ecsact_get_component(registry_id, entity_id, comp_id, nullptr);
}
index += 1;
}
}
Expand Down

0 comments on commit 5b751ce

Please sign in to comment.