From cf6c0505010420ca87b2bf6431dc11c5ebf55030 Mon Sep 17 00:00:00 2001 From: copygirl Date: Fri, 11 Nov 2022 20:44:35 +0100 Subject: [PATCH] Fix iterator not working with fixed terms --- src/gaemstone/ECS/Iterator.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gaemstone/ECS/Iterator.cs b/src/gaemstone/ECS/Iterator.cs index 3e5065c..ca82b61 100644 --- a/src/gaemstone/ECS/Iterator.cs +++ b/src/gaemstone/ECS/Iterator.cs @@ -51,8 +51,9 @@ public unsafe partial class Iterator { fixed (ecs_iter_t* ptr = &Value) { var size = (ulong)Unsafe.SizeOf(); + var isSelf = ecs_field_is_self(ptr, index); var pointer = ecs_field_w_size(ptr, size, index); - return new Span(pointer, Count); + return new(pointer, isSelf ? Count : 1); } }