diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/ix2.c | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -543,8 +543,10 @@ unsigned ix2_search_by_point(ix2_t *ix2, v2f_t *point, ix2_search_cb cb, void *c ix2_object_t *o = ref->object; r = cb(cb_context, o, &o->position, &o->aabb, o->object); - if (r == IX2_SEARCH_STOP) + if (r == IX2_SEARCH_STOP) { + n_hits++; break; + } if (r == IX2_SEARCH_IGNORE) continue; @@ -641,8 +643,10 @@ unsigned ix2_search_by_aabb(ix2_t *ix2, float x, float y, aabb_t *search_aabb, i ix2_search_status_t r; r = cb(cb_context, o, &o->position, &o->aabb, o->object); - if (r == IX2_SEARCH_STOP) + if (r == IX2_SEARCH_STOP) { + n_hits++; break; + } if (r == IX2_SEARCH_IGNORE) continue; |