Using implicit pointer derefs + fixing crashes on clearing entities
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user