aboutsummaryrefslogtreecommitdiff
path: root/src/entity_list.odin
diff options
context:
space:
mode:
authoriamcheeseman <[hidden email]>2026-01-14 19:21:33 -0500
committeriamcheeseman <[hidden email]>2026-01-14 19:21:33 -0500
commitd6f276be6bc1214c88cfc5346ceb7a5bea610638 (patch)
tree9b1f4d1aa4a02f2855c14dea2bf440f58343cc0e /src/entity_list.odin
parent1b8553bf96017795dcf081b78371c3b2a8d5ecc5 (diff)
i HATE physics bugs (i haven't fixed them yet)
Diffstat (limited to 'src/entity_list.odin')
-rw-r--r--src/entity_list.odin6
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) {