Skip to content

Commit 5b751ce

Browse files
authored
fix: fauly logic on index of get components (#154)
1 parent afda94f commit 5b751ce

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

runtime/ecsact_rt_entt_core.cc

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -176,14 +176,12 @@ void ecsact_get_components(
176176

177177
auto index = 0;
178178
for(auto comp_id : all_component_ids) {
179-
if(index >= max_components_count) {
180-
break;
181-
}
182-
183179
if(ecsact_has_component(registry_id, entity_id, comp_id, nullptr)) {
184-
out_component_ids[index] = comp_id;
185-
out_components_data[index] =
186-
ecsact_get_component(registry_id, entity_id, comp_id, nullptr);
180+
if(index < max_components_count) {
181+
out_component_ids[index] = comp_id;
182+
out_components_data[index] =
183+
ecsact_get_component(registry_id, entity_id, comp_id, nullptr);
184+
}
187185
index += 1;
188186
}
189187
}

0 commit comments

Comments
 (0)