mirror of https://github.com/OpenTTD/OpenTTD
Change: Ships enter depots when they are in the middle of the two depot tiles (not in the center of a tile).
# Conflicts: # src/ship_cmd.cpppull/8480/head
parent
e91483c588
commit
9869611ad8
|
@ -773,13 +773,6 @@ static void ShipController(Ship *v)
|
|||
UpdateVehicleTimetable(v, true);
|
||||
v->IncrementRealOrderIndex();
|
||||
v->current_order.MakeDummy();
|
||||
} else if (v->current_order.IsType(OT_GOTO_DEPOT) &&
|
||||
v->dest_tile == gp.new_tile) {
|
||||
/* Depot orders really need to reach the tile */
|
||||
if ((gp.x & 0xF) == 8 && (gp.y & 0xF) == 8) {
|
||||
VehicleEnterDepot(v);
|
||||
return;
|
||||
}
|
||||
} else if (v->current_order.IsType(OT_GOTO_STATION) && IsDockingTile(gp.new_tile)) {
|
||||
/* Process station in the orderlist. */
|
||||
Station *st = Station::Get(v->current_order.GetDestination());
|
||||
|
@ -800,6 +793,16 @@ static void ShipController(Ship *v)
|
|||
/* New tile */
|
||||
if (!IsValidTile(gp.new_tile)) return ReverseShip(v);
|
||||
|
||||
if (v->current_order.IsType(OT_GOTO_DEPOT) &&
|
||||
IsShipDepotTile(gp.new_tile) &&
|
||||
GetOtherShipDepotTile(gp.new_tile) == gp.old_tile &&
|
||||
v->current_order.GetDestination() == GetDepotIndex(gp.new_tile)) {
|
||||
HandleShipEnterDepot(v);
|
||||
v->UpdatePosition();
|
||||
v->UpdateViewport(true, true);
|
||||
return;
|
||||
}
|
||||
|
||||
const DiagDirection diagdir = DiagdirBetweenTiles(gp.old_tile, gp.new_tile);
|
||||
assert(diagdir != INVALID_DIAGDIR);
|
||||
const TrackBits tracks = GetAvailShipTracks(gp.new_tile, diagdir);
|
||||
|
|
Loading…
Reference in New Issue