Fix incorrect arg in Entity.init

main
copygirl 1 year ago
parent 1b2bd5660e
commit c8ec920290
  1. 2
      src/entity.zig

@ -85,7 +85,7 @@ pub fn Entity(comptime ctx: anytype) type {
/// To set their values you'll need to use `set(...)` on the /// To set their values you'll need to use `set(...)` on the
/// `Entity` returned from this function. /// `Entity` returned from this function.
pub fn init(world: *World(ctx), config: Config, ids: anytype) !Self { pub fn init(world: *World(ctx), config: Config, ids: anytype) !Self {
const meta = @typeInfo(@TypeOf(add)); const meta = @typeInfo(@TypeOf(ids));
if (meta != .Struct or (meta.Struct.is_tuple == false and meta.Struct.fields.len > 0)) if (meta != .Struct or (meta.Struct.is_tuple == false and meta.Struct.fields.len > 0))
@compileError("Expected tuple or empty struct, got '" ++ @typeName(@TypeOf(ids)) ++ "'"); @compileError("Expected tuple or empty struct, got '" ++ @typeName(@TypeOf(ids)) ++ "'");
if (meta.Struct.fields.len > c.FLECS_ID_DESC_MAX) if (meta.Struct.fields.len > c.FLECS_ID_DESC_MAX)

Loading…
Cancel
Save