Update to 12.0-RC1
This commit is contained in:
@@ -2720,19 +2720,24 @@ static CommandCost RemoveDock(TileIndex tile, DoCommandFlag flags)
|
||||
ClearDockingTilesCheckingNeighbours(tile1);
|
||||
ClearDockingTilesCheckingNeighbours(tile2);
|
||||
|
||||
/* All ships that were going to our station, can't go to it anymore.
|
||||
* Just clear the order, then automatically the next appropriate order
|
||||
* will be selected and in case of no appropriate order it will just
|
||||
* wander around the world. */
|
||||
if (!(st->facilities & FACIL_DOCK)) {
|
||||
for (Ship *s : Ship::Iterate()) {
|
||||
if (s->current_order.IsType(OT_LOADING) && s->current_order.GetDestination() == st->index) {
|
||||
s->LeaveStation();
|
||||
}
|
||||
for (Ship *s : Ship::Iterate()) {
|
||||
/* Find all ships going to our dock. */
|
||||
if (s->current_order.GetDestination() != st->index) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (s->current_order.IsType(OT_GOTO_STATION) && s->current_order.GetDestination() == st->index) {
|
||||
s->SetDestTile(s->GetOrderStationLocation(st->index));
|
||||
}
|
||||
/* Find ships that are marked as "loading" but are no longer on a
|
||||
* docking tile. Force them to leave the station (as they were loading
|
||||
* on the removed dock). */
|
||||
if (s->current_order.IsType(OT_LOADING) && !(IsDockingTile(s->tile) && IsShipDestinationTile(s->tile, st->index))) {
|
||||
s->LeaveStation();
|
||||
}
|
||||
|
||||
/* If we no longer have a dock, mark the order as invalid and send
|
||||
* the ship to the next order (or, if there is none, make it
|
||||
* wander the world). */
|
||||
if (s->current_order.IsType(OT_GOTO_STATION) && !(st->facilities & FACIL_DOCK)) {
|
||||
s->SetDestTile(s->GetOrderStationLocation(st->index));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3688,8 +3693,11 @@ void DeleteStaleLinks(Station *from)
|
||||
auto iter = vehicles.begin();
|
||||
while (iter != vehicles.end()) {
|
||||
Vehicle *v = *iter;
|
||||
|
||||
LinkRefresher::Run(v, false); // Don't allow merging. Otherwise lg might get deleted.
|
||||
/* Do not refresh links of vehicles that have been stopped in depot for a long time. */
|
||||
if (!v->IsStoppedInDepot() || static_cast<uint>(_date - v->date_of_last_service) <=
|
||||
LinkGraph::STALE_LINK_DEPOT_TIMEOUT) {
|
||||
LinkRefresher::Run(v, false); // Don't allow merging. Otherwise lg might get deleted.
|
||||
}
|
||||
if (edge.LastUpdate() == _date) {
|
||||
updated = true;
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user