Improvement to intersection data calculation

This commit is contained in:
2026-05-01 14:46:30 +02:00
parent e475814c85
commit 2a3064b0fe
5 changed files with 70 additions and 11 deletions

View File

@@ -89,7 +89,7 @@ pub const RoadManager = struct {
/// Returns if pos is pointing at a road, or null if it isn't at any
pub fn getHighlightedRoad(self: *const RoadManager, pos: Vector2) ?*Road {
for (self.roads.items) |road| {
if (road.isHighlighted(pos)) return road;
if (road.collides(pos)) return road;
}
return null;