Fix: Prevent ships moving into docks after finishing (un)loading. (#6791)
This commit is contained in:
@@ -537,6 +537,10 @@ static void ShipController(Ship *v)
|
||||
if (v->current_order.IsType(OT_LEAVESTATION)) {
|
||||
v->current_order.Free();
|
||||
SetWindowWidgetDirty(WC_VEHICLE_VIEW, v->index, WID_VV_START_STOP);
|
||||
/* Test if continuing forward would lead to a dead-end, moving into the dock. */
|
||||
DiagDirection exitdir = VehicleExitDir(v->direction, v->state);
|
||||
TileIndex tile = TileAddByDiagDir(v->tile, exitdir);
|
||||
if (TrackStatusToTrackBits(GetTileTrackStatus(tile, TRANSPORT_WATER, 0, exitdir)) == TRACK_BIT_NONE) goto reverse_direction;
|
||||
} else if (v->dest_tile != 0) {
|
||||
/* We have a target, let's see if we reached it... */
|
||||
if (v->current_order.IsType(OT_GOTO_WAYPOINT) &&
|
||||
|
Reference in New Issue
Block a user