From de088f69e6619b2bdccbf48a4f648111a2a5e494 Mon Sep 17 00:00:00 2001 From: harper Date: Sat, 10 Oct 2026 12:07:33 -0700 Subject: [PATCH] single returns nil when empty --- src/entities.odin | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/entities.odin b/src/entities.odin index 8e16b60..959f5cf 100644 --- a/src/entities.odin +++ b/src/entities.odin @@ -44,7 +44,7 @@ single :: proc(storage: ^Storage($T)) -> (Entity, ^T) { for i, &v in slice(storage) { return i, &v } - return Entity{}, new(T) + return 0, nil } // get component of type from entity @@ -54,8 +54,3 @@ get_component :: proc(entity: Entity, storage: ^Storage($T)) -> ^T { } return new(T) } - -// alias for direct mutation access -get_component_with_ref :: proc(entity: Entity, storage: ^Storage($T)) -> ^T { - return get_component(entity, storage) -}