| 285 | } |
| 286 | |
| 287 | Trackdir Ship::GetVehicleTrackdir() const |
| 288 | { |
| 289 | if (this->vehstatus.Test(VehState::Crashed)) return INVALID_TRACKDIR; |
| 290 | |
| 291 | if (this->IsInDepot()) { |
| 292 | /* We'll assume the ship is facing outwards */ |
| 293 | return DiagDirToDiagTrackdir(GetShipDepotDirection(this->tile)); |
| 294 | } |
| 295 | |
| 296 | if (this->state == TRACK_BIT_WORMHOLE) { |
| 297 | /* ship on aqueduct, so just use its direction and assume a diagonal track */ |
| 298 | return DiagDirToDiagTrackdir(DirToDiagDir(this->direction)); |
| 299 | } |
| 300 | |
| 301 | return TrackDirectionToTrackdir(FindFirstTrack(this->state), this->direction); |
| 302 | } |
| 303 | |
| 304 | void Ship::MarkDirty() |
| 305 | { |
no test coverage detected