mirror of https://github.com/OpenTTD/OpenTTD
(svn r4323) -Regression: Clear the slot assignments of all vehicles heading twoards a road stop if that road stop gets removed
This issue was fixed in r2210 and reintroduced in r4259 when the multistop handling was overhauled.release/0.5
parent
ffadd91ca9
commit
da60a82021
|
@ -1410,6 +1410,18 @@ static int32 RemoveRoadStop(Station *st, uint32 flags, TileIndex tile)
|
||||||
if (!EnsureNoVehicle(tile)) return CMD_ERROR;
|
if (!EnsureNoVehicle(tile)) return CMD_ERROR;
|
||||||
|
|
||||||
if (flags & DC_EXEC) {
|
if (flags & DC_EXEC) {
|
||||||
|
Vehicle* v;
|
||||||
|
|
||||||
|
/* Clear the slot assignment of all vehicles heading for this road stop */
|
||||||
|
if (cur_stop->num_vehicles != 0) {
|
||||||
|
FOR_ALL_VEHICLES(v) {
|
||||||
|
if (v->type == VEH_Road && v->u.road.slot == cur_stop) {
|
||||||
|
ClearSlot(v);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
assert(cur_stop->num_vehicles == 0);
|
||||||
|
|
||||||
DoClearSquare(tile);
|
DoClearSquare(tile);
|
||||||
|
|
||||||
cur_stop->used = false;
|
cur_stop->used = false;
|
||||||
|
|
Loading…
Reference in New Issue