* Get the tracks of the train vehicle. * @return Current tracks of the vehicle. */
| 4224 | * @return Current tracks of the vehicle. |
| 4225 | */ |
| 4226 | Trackdir Train::GetVehicleTrackdir() const |
| 4227 | { |
| 4228 | if (this->vehstatus.Test(VehState::Crashed)) return INVALID_TRACKDIR; |
| 4229 | |
| 4230 | if (this->track == TRACK_BIT_DEPOT) { |
| 4231 | /* We'll assume the train is facing outwards */ |
| 4232 | return DiagDirToDiagTrackdir(GetRailDepotDirection(this->tile)); // Train in depot |
| 4233 | } |
| 4234 | |
| 4235 | if (this->track == TRACK_BIT_WORMHOLE) { |
| 4236 | /* train in tunnel or on bridge, so just use its direction and assume a diagonal track */ |
| 4237 | return DiagDirToDiagTrackdir(DirToDiagDir(this->direction)); |
| 4238 | } |
| 4239 | |
| 4240 | return TrackDirectionToTrackdir(FindFirstTrack(this->track), this->direction); |
| 4241 | } |
| 4242 | |
| 4243 | uint16_t Train::GetMaxWeight() const |
| 4244 | { |
no test coverage detected