Some more fixes and some more errors
This commit is contained in:
@@ -77,15 +77,19 @@ pub const Simulator = struct {
|
||||
}
|
||||
else if (self.mode == .BUILD and rl.isMouseButtonReleased(.right)) {
|
||||
if (self.node_man.temp_node) |node| {
|
||||
// todo
|
||||
// todo proper error handling
|
||||
self.node_man.removeNode(node) catch {};
|
||||
}
|
||||
}
|
||||
else if (self.mode == .DELETE and rl.isMouseButtonReleased(.left) and self.road_man.highlighted_road != null) {
|
||||
// todo
|
||||
const nodes = self.road_man.highlighted_road.?.nodes;
|
||||
self.road_man.remove(self.road_man.highlighted_road.?) catch |err| {
|
||||
std.debug.panic("Failed to remove the road: {}\n", .{err});
|
||||
};
|
||||
|
||||
// todo proper error handling
|
||||
self.node_man.removeNode(nodes[0]) catch {};
|
||||
self.node_man.removeNode(nodes[1]) catch {};
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user