1
0
mirror of https://github.com/OpenTTD/OpenTTD.git synced 2025-08-20 04:59:11 +00:00

Change: Adapt GetVehicleTrackdir() for ships.

This commit is contained in:
Juanjo
2013-12-27 18:06:30 +00:00
committed by J0anJosep
parent f713a3525d
commit ea9ac51812

View File

@@ -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));
}