From ea9ac51812c432733192f67d72153d023859af4d Mon Sep 17 00:00:00 2001 From: Juanjo Date: Fri, 27 Dec 2013 18:06:30 +0000 Subject: [PATCH] Change: Adapt GetVehicleTrackdir() for ships. --- src/ship_cmd.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/ship_cmd.cpp b/src/ship_cmd.cpp index 1695c4e153..4d7ce518ad 100644 --- a/src/ship_cmd.cpp +++ b/src/ship_cmd.cpp @@ -290,11 +290,12 @@ Trackdir Ship::GetVehicleTrackdir() const if (this->vehstatus & VS_CRASHED) return INVALID_TRACKDIR; if (this->IsInDepot()) { - /* We'll assume the ship is facing outwards */ - return DiagDirToDiagTrackdir(GetShipDepotDirection(this->tile)); + /* Only old depots need it. */ + /* We'll assume the ship is facing outwards. */ + if (this->state == TRACK_BIT_DEPOT) return DiagDirToDiagTrackdir(GetShipDepotDirection(this->tile)); } - if (this->state == TRACK_BIT_WORMHOLE) { + if (this->state == TRACK_BIT_WORMHOLE || this->IsInDepot()) { /* ship on aqueduct, so just use its direction and assume a diagonal track */ return DiagDirToDiagTrackdir(DirToDiagDir(this->direction)); }