| 1751 | } |
| 1752 | |
| 1753 | Trackdir RoadVehicle::GetVehicleTrackdir() const |
| 1754 | { |
| 1755 | if (this->vehstatus.Test(VehState::Crashed)) return INVALID_TRACKDIR; |
| 1756 | |
| 1757 | if (this->IsInDepot()) { |
| 1758 | /* We'll assume the road vehicle is facing outwards */ |
| 1759 | return DiagDirToDiagTrackdir(GetRoadDepotDirection(this->tile)); |
| 1760 | } |
| 1761 | |
| 1762 | if (IsBayRoadStopTile(this->tile)) { |
| 1763 | /* We'll assume the road vehicle is facing outwards */ |
| 1764 | return DiagDirToDiagTrackdir(GetBayRoadStopDir(this->tile)); // Road vehicle in a station |
| 1765 | } |
| 1766 | |
| 1767 | /* Drive through road stops / wormholes (tunnels) */ |
| 1768 | if (this->state > RVSB_TRACKDIR_MASK) return DiagDirToDiagTrackdir(DirToDiagDir(this->direction)); |
| 1769 | |
| 1770 | /* If vehicle's state is a valid track direction (vehicle is not turning around) return it, |
| 1771 | * otherwise transform it into a valid track direction */ |
| 1772 | return (Trackdir)((IsReversingRoadTrackdir((Trackdir)this->state)) ? (this->state - 6) : this->state); |
| 1773 | } |
| 1774 | |
| 1775 | uint16_t RoadVehicle::GetMaxWeight() const |
| 1776 | { |
nothing calls this directly
no test coverage detected