Skip to content

Commit

Permalink
Return false if id is 0 in Ecs.TypeIdIs
Browse files Browse the repository at this point in the history
  • Loading branch information
BeanCheeseBurrito committed Oct 15, 2024
1 parent 63a0702 commit 665ab84
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Flecs.NET/Core/Ecs/Macros.cs
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ public static ulong TermRefId(ref ecs_term_ref_t termRef)
public static bool TypeIdIs<T>(ecs_world_t* world, ulong id)
{
ulong typeId = Type<T>.Id(world);
return typeId == id || typeId == ecs_get_typeid(world, id);
return typeId == id || (id != 0 && typeId == ecs_get_typeid(world, id));
}

[MethodImpl(MethodImplOptions.AggressiveInlining)]
Expand Down

0 comments on commit 665ab84

Please sign in to comment.