Make Entity.getMut return non-nullable pointer

main
copygirl 9 months ago
parent 1b303d0b3a
commit 1c44cf61c7
  1. 2
      src/entity.zig

@ -311,7 +311,7 @@ pub fn Entity(comptime ctx: anytype) type {
return @alignCast(@ptrCast(ptr)); return @alignCast(@ptrCast(ptr));
} }
pub fn getMut(self: Self, comptime T: type) ?*T { pub fn getMut(self: Self, comptime T: type) *T {
const id = Context.lookup(T).*; const id = Context.lookup(T).*;
const ptr = c.ecs_get_mut_id(self.world.raw, self.raw, id); const ptr = c.ecs_get_mut_id(self.world.raw, self.raw, id);
return @alignCast(@ptrCast(ptr)); return @alignCast(@ptrCast(ptr));

Loading…
Cancel
Save