* Get the correct velocity units depending on the vehicle type and whether we're using real-time units. * @param type VehicleType to convert velocity for. * @return The Units for the proper vehicle and time mode. */
| 949 | * @return The Units for the proper vehicle and time mode. |
| 950 | */ |
| 951 | static const Units GetVelocityUnits(VehicleType type) |
| 952 | { |
| 953 | uint8_t setting = (type == VEH_SHIP || type == VEH_AIRCRAFT) ? _settings_game.locale.units_velocity_nautical : _settings_game.locale.units_velocity; |
| 954 | |
| 955 | assert(setting < lengthof(_units_velocity_calendar)); |
| 956 | assert(setting < lengthof(_units_velocity_realtime)); |
| 957 | |
| 958 | if (TimerGameEconomy::UsingWallclockUnits()) return _units_velocity_realtime[setting]; |
| 959 | |
| 960 | return _units_velocity_calendar[setting]; |
| 961 | } |
| 962 | |
| 963 | /** |
| 964 | * Convert the given (internal) speed to the display speed. |
no outgoing calls
no test coverage detected