MCPcopy Create free account
hub / github.com/OpenTTD/OpenTTD / CanUpdateServiceInterval

Function CanUpdateServiceInterval

src/settings_table.cpp:240–252  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

238}
239
240static bool CanUpdateServiceInterval(VehicleType, int32_t &new_value)
241{
242 VehicleDefaultSettings *vds;
243 if (_game_mode == GM_MENU || !Company::IsValidID(_current_company)) {
244 vds = &_settings_client.company.vehicle;
245 } else {
246 vds = &Company::Get(_current_company)->settings.vehicle;
247 }
248
249 /* Test if the interval is valid */
250 int32_t interval = GetServiceIntervalClamped(new_value, vds->servint_ispercent);
251 return new_value == 0 || interval == new_value;
252}
253
254static void UpdateServiceInterval(VehicleType type, int32_t new_value)
255{

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected