Add road layout change counter, add to road veh path caches
Update layout counter when non-leaf road bits are added or removed
This commit is contained in:
@@ -1031,6 +1031,11 @@ static Trackdir RoadFindPathToDest(RoadVehicle *v, TileIndex tile, DiagDirection
|
||||
return_track(FindFirstBit2x64(trackdirs));
|
||||
}
|
||||
|
||||
/* Path cache is out of date, clear it */
|
||||
if (!v->path.empty() && v->path.layout_ctr != _road_layout_change_counter) {
|
||||
v->path.clear();
|
||||
}
|
||||
|
||||
/* Attempt to follow cached path. */
|
||||
if (!v->path.empty()) {
|
||||
if (v->path.tile.front() != tile) {
|
||||
|
Reference in New Issue
Block a user