diff options
| author | iamcheeseman <[hidden email]> | 2026-01-14 19:21:33 -0500 |
|---|---|---|
| committer | iamcheeseman <[hidden email]> | 2026-01-14 19:21:33 -0500 |
| commit | d6f276be6bc1214c88cfc5346ceb7a5bea610638 (patch) | |
| tree | 9b1f4d1aa4a02f2855c14dea2bf440f58343cc0e /src/entity_list.odin | |
| parent | 1b8553bf96017795dcf081b78371c3b2a8d5ecc5 (diff) | |
i HATE physics bugs (i haven't fixed them yet)
Diffstat (limited to 'src/entity_list.odin')
| -rw-r--r-- | src/entity_list.odin | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/entity_list.odin b/src/entity_list.odin index ce69be8..3ee553e 100644 --- a/src/entity_list.odin +++ b/src/entity_list.odin @@ -48,7 +48,9 @@ delete_entity :: proc(list: ^Entity_List($T), handle: Entity_Handle) { } get_entity :: proc(list: Entity_List($T), h: Entity_Handle) -> ^T { - if h.idx < 1 || h.idx >= len(list.items) || list.items[h.idx].handle == h { + if h.idx < 1 || + h.idx >= u32(len(list.items)) || + list.items[h.idx].handle != h { return nil } return &list.items[h.idx] @@ -61,7 +63,7 @@ active_entity_count :: proc(list: Entity_List($T)) -> int { Entity_List_Iter :: struct($T: typeid) { list: Entity_List(T), - idx: int, + idx: int, } iter_entity_list :: proc(list: Entity_List($T)) -> Entity_List_Iter(T) { |
