diff options
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) { |
