Fixed the issue of newly built intersecting node not connecting to all existing (intersecting) roads
This commit is contained in:
@@ -37,9 +37,8 @@ pub const RoadManager = struct {
|
||||
/// Function which creates the road object, its pointer, adds it to the list
|
||||
/// and then also references that same road to the bounding nodes
|
||||
pub fn addRoad(self: *RoadManager, allocator: std.mem.Allocator, start: *Node, end: *Node) !void {
|
||||
const road: Road = .init(self.getNextID(), start, end);
|
||||
const road_ptr = try allocator.create(Road);
|
||||
road_ptr.* = road;
|
||||
road_ptr.* = Road.init(self.getNextID(), start, end);
|
||||
try self.roads.append(allocator, road_ptr);
|
||||
|
||||
const ref = self.roads.items[self.roads.items.len - 1];
|
||||
|
||||
Reference in New Issue
Block a user