Skip to content

Commit 47f4eff

Browse files
Add ecs_id_is_valid assert to Entity.Add()
1 parent 035998b commit 47f4eff

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/Flecs.NET/Core/Entity.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1083,6 +1083,7 @@ public bool IsChildOf<TEnum>(TEnum enumMember) where TEnum : Enum
10831083
/// <returns></returns>
10841084
public ref Entity Add(ulong id)
10851085
{
1086+
Ecs.Assert(ecs_id_is_valid(World, id) == Macros.True, nameof(ECS_INVALID_OPERATION));
10861087
ecs_add_id(World, Id, id);
10871088
return ref this;
10881089
}

0 commit comments

Comments
 (0)