From 9a8bf055362519f32d0567404047a04fdcca5bfb Mon Sep 17 00:00:00 2001 From: Pixeye <19838200+PixeyeHQ@users.noreply.github.com> Date: Fri, 3 Jul 2020 12:57:05 +0200 Subject: [PATCH] Fix #59 --- Runtime/LibEcs/EntityMeta.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Runtime/LibEcs/EntityMeta.cs b/Runtime/LibEcs/EntityMeta.cs index 9064569b..a2550352 100644 --- a/Runtime/LibEcs/EntityMeta.cs +++ b/Runtime/LibEcs/EntityMeta.cs @@ -57,7 +57,7 @@ public void AddComponent(int type) [MethodImpl(MethodImplOptions.AggressiveInlining)] public void RemoveComponent(int type, int entityID) { - for (var tRemoveIndex = 0; tRemoveIndex < componentsAmount; tRemoveIndex++) + for (var tRemoveIndex = 0; tRemoveIndex <= componentsAmount; tRemoveIndex++) { if (components[tRemoveIndex] == type) { @@ -85,7 +85,7 @@ public void AddGroup(int type) [MethodImpl(MethodImplOptions.AggressiveInlining)] public void RemoveGroup(int type) { - for (var tRemoveIndex = 0; tRemoveIndex < componentsAmount; tRemoveIndex++) + for (var tRemoveIndex = 0; tRemoveIndex <= componentsAmount; tRemoveIndex++) { if (groups[tRemoveIndex] == type) { @@ -100,7 +100,7 @@ public void RemoveGroup(int type) [MethodImpl(MethodImplOptions.AggressiveInlining)] public bool AlreadyInGroup(int groupID) { - for (var gIndex = 0; gIndex < groupsAmount; gIndex++) + for (var gIndex = 0; gIndex <= groupsAmount; gIndex++) { if (groups[gIndex] == groupID) return true; }