* Checks if a vehicle type is disabled for all/ai companies. * @param type The vehicle type which shall be checked. * @param ai If true, check if the type is disabled for AI companies, otherwise check if * the vehicle type is disabled for human companies. * @return Whether or not a vehicle type is disabled. */
| 946 | * @return Whether or not a vehicle type is disabled. |
| 947 | */ |
| 948 | static bool IsVehicleTypeDisabled(VehicleType type, bool ai) |
| 949 | { |
| 950 | switch (type) { |
| 951 | case VEH_TRAIN: return _settings_game.vehicle.max_trains == 0 || (ai && _settings_game.ai.ai_disable_veh_train); |
| 952 | case VEH_ROAD: return _settings_game.vehicle.max_roadveh == 0 || (ai && _settings_game.ai.ai_disable_veh_roadveh); |
| 953 | case VEH_SHIP: return _settings_game.vehicle.max_ships == 0 || (ai && _settings_game.ai.ai_disable_veh_ship); |
| 954 | case VEH_AIRCRAFT: return _settings_game.vehicle.max_aircraft == 0 || (ai && _settings_game.ai.ai_disable_veh_aircraft); |
| 955 | |
| 956 | default: NOT_REACHED(); |
| 957 | } |
| 958 | } |
| 959 | |
| 960 | /** Daily check to offer an exclusive engine preview to the companies. */ |
| 961 | static const IntervalTimer<TimerGameCalendar> _calendar_engines_daily({TimerGameCalendar::DAY, TimerGameCalendar::Priority::ENGINE}, [](auto) |
no test coverage detected