Implemented removal of cars if the node they're on gets removed
This commit is contained in:
@@ -45,7 +45,10 @@ draw_nodes :: proc(self: ^Simulator) {
|
||||
@(private="file")
|
||||
draw_cars :: proc(self: ^Simulator) {
|
||||
for &car in self.cars {
|
||||
pos := self.nodes[car.origin].pos
|
||||
ref := car.pos.ref
|
||||
// TODO fix in the future
|
||||
// let's fix it by tracking length of the road and
|
||||
pos := car.pos.type == .Node ? self.nodes[ref].pos : self.nodes[self.roads[ref].nodes[0]].pos
|
||||
|
||||
rect := rl.Rectangle {
|
||||
x = pos.x,
|
||||
|
||||
Reference in New Issue
Block a user