Using implicit pointer derefs + fixing crashes on clearing entities

This commit is contained in:
2026-04-29 17:16:12 +02:00
parent 9defec8448
commit 7348861145
3 changed files with 11 additions and 10 deletions

View File

@@ -44,7 +44,7 @@ pub const NodeManager = struct {
const road: Road = .init(0, node, &cur_node);
road.draw(false);
node.*.draw(c.NODE_TEMP_COLOUR);
node.draw(c.NODE_TEMP_COLOUR);
cur_node.draw(c.NODE_CURSOR_COLOUR);
}
}
@@ -77,6 +77,7 @@ pub const NodeManager = struct {
pub fn clear(self: *NodeManager, allocator: std.mem.Allocator) !void {
self.temp_node = null;
for (self.nodes.items) |node| {
node.roads.clearRetainingCapacity();
try node.deinit(allocator);
}
self.nodes.clearRetainingCapacity();