|
|
|
@ -2,6 +2,7 @@ const std = @import("std"); |
|
|
|
|
const Allocator = std.mem.Allocator; |
|
|
|
|
|
|
|
|
|
const meta = @import("./meta.zig"); |
|
|
|
|
const errors = @import("./errors.zig"); |
|
|
|
|
const flecszigble = @import("./main.zig"); |
|
|
|
|
const Path = flecszigble.Path; |
|
|
|
|
const c = flecszigble.c; |
|
|
|
@ -133,7 +134,7 @@ pub fn Entity(comptime ctx: anytype) type { |
|
|
|
|
var desc = std.mem.zeroInit(c.ecs_entity_desc_t, .{ .sep = "".ptr, .name = n.ptr }); |
|
|
|
|
desc.add[0] = c.ecs_pair(c.EcsChildOf, parent_); |
|
|
|
|
scope = c.ecs_entity_init(world.raw, &desc); |
|
|
|
|
if (scope == 0) return flecszigble.getLastErrorOrUnknown(); |
|
|
|
|
if (scope == 0) return errors.getLastErrorOrUnknown(); |
|
|
|
|
} else scope = found; |
|
|
|
|
}, |
|
|
|
|
} |
|
|
|
@ -162,7 +163,7 @@ pub fn Entity(comptime ctx: anytype) type { |
|
|
|
|
return error.FoundChildOf; |
|
|
|
|
|
|
|
|
|
const result = c.ecs_entity_init(world.raw, &desc); |
|
|
|
|
if (result == 0) return flecszigble.getLastErrorOrUnknown(); |
|
|
|
|
if (result == 0) return errors.getLastErrorOrUnknown(); |
|
|
|
|
return Self.fromRaw(world, result); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|