diff --git a/src/gaemstone.ECS/Entity.cs b/src/gaemstone.ECS/Entity.cs index be1abc9..2d96b3e 100644 --- a/src/gaemstone.ECS/Entity.cs +++ b/src/gaemstone.ECS/Entity.cs @@ -50,7 +50,8 @@ public unsafe readonly partial struct Entity public Entity CreateLookup() { ref var lookup = ref Lookup.Entity.Value; - if (lookup.IsSome) throw new InvalidOperationException( + if (lookup == this) { /* Don't throw if lookup already has the same entity set. */ } + else if (lookup.IsSome) throw new InvalidOperationException( $"The lookup for type {typeof(T)} in context {typeof(TContext)} is already in use by {lookup}"); lookup = this; return this;