Skip to content

Commit

Permalink
Merge pull request #47 from justinian/master
Browse files Browse the repository at this point in the history
Fix query bug when fetching filtered entity lists
  • Loading branch information
inlife authored Jan 20, 2025
2 parents 0fe2725 + edc8c49 commit d0b7a59
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions code/source/query.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ int32_t librg_world_fetch_chunkarray(librg_world *world, const librg_chunk *chun
size_t buffer_limit = *entity_amount;
size_t total_count = zpl_array_count(wld->entity_map.entries);

for (size_t i=0; i < LIBRG_MIN(buffer_limit, total_count); ++i) {
for (size_t i=0; i < total_count && count < buffer_limit; ++i) {
uint64_t entity_id = wld->entity_map.entries[i].key;
librg_entity_t *entity = &wld->entity_map.entries[i].value;
iterated++;
Expand Down Expand Up @@ -86,7 +86,7 @@ int32_t librg_world_fetch_ownerarray(librg_world *world, const int64_t *owner_id
size_t buffer_limit = *entity_amount;
size_t total_count = zpl_array_count(wld->entity_map.entries);

for (size_t i=0; i < LIBRG_MIN(buffer_limit, total_count); ++i) {
for (size_t i=0; i < total_count && count < buffer_limit; ++i) {
uint64_t entity_id = wld->entity_map.entries[i].key;
librg_entity_t *entity = &wld->entity_map.entries[i].value;
iterated++;
Expand Down

0 comments on commit d0b7a59

Please sign in to comment.