(svn r1538) -Feature: [988816] Disable servicing when breakdowns set to none (jaguar7)

This commit is contained in:
darkvater 2005-01-16 12:29:52 +00:00
parent 208a9b8547
commit 37f56fa324
5 changed files with 8 additions and 1 deletions

View File

@ -1044,6 +1044,7 @@ STR_CONFIG_PATCHES_SERVINT_AIRCRAFT :{LTBLUE}Default service interval for air
STR_CONFIG_PATCHES_SERVINT_AIRCRAFT_DISABLED :{LTBLUE}Default service interval for aircraft: {ORANGE}disabled
STR_CONFIG_PATCHES_SERVINT_SHIPS :{LTBLUE}Default service interval for ships: {ORANGE}{STRING} days/%
STR_CONFIG_PATCHES_SERVINT_SHIPS_DISABLED :{LTBLUE}Default service interval for ships: {ORANGE}disabled
STR_CONFIG_PATCHES_NOSERVICE :{LTBLUE}Disable servicing when breakdowns set to none: {ORANGE}{STRING}
STR_CONFIG_PATCHES_COLORED_NEWS_DATE :{LTBLUE}Coloured news appears in: {ORANGE}{STRING}
STR_CONFIG_PATCHES_STARTING_DATE :{LTBLUE}Starting date: {ORANGE}{STRING}
@ -2789,4 +2790,4 @@ STR_MAGLEV_VEHICLES :Maglev Vehicles
############ End of list of rail types
STR_TINY_BLACK :{BLACK}{TINYFONT}{COMMA16}
STR_TINY_BLACK :{BLACK}{TINYFONT}{COMMA16}

View File

@ -876,6 +876,7 @@ const SettingDesc patch_settings[] = {
{"servint_roadveh", SDT_UINT16, (void*)150, &_patches.servint_roadveh, NULL},
{"servint_ships", SDT_UINT16, (void*)360, &_patches.servint_ships, NULL},
{"servint_aircraft", SDT_UINT16, (void*)100, &_patches.servint_aircraft, NULL},
{"no_servicing_if_no_breakdowns", SDT_BOOL, (void*)0, &_patches.no_servicing_if_no_breakdowns, NULL},
{"new_pathfinding", SDT_BOOL, (void*)true, &_patches.new_pathfinding, NULL},
{"pf_maxlength", SDT_UINT16, (void*)512, &_patches.pf_maxlength, NULL},

View File

@ -660,6 +660,7 @@ static const PatchEntry _patches_vehicles[] = {
{PE_UINT16, PF_0ISDIS, STR_CONFIG_PATCHES_SERVINT_ROADVEH, "servint_roadveh", &_patches.servint_roadveh, 5,800, 5, &InValidateDetailsWindow},
{PE_UINT16, PF_0ISDIS, STR_CONFIG_PATCHES_SERVINT_AIRCRAFT, "servint_aircraft", &_patches.servint_aircraft, 5,800, 5, &InValidateDetailsWindow},
{PE_UINT16, PF_0ISDIS, STR_CONFIG_PATCHES_SERVINT_SHIPS, "servint_ships", &_patches.servint_ships, 5,800, 5, &InValidateDetailsWindow},
{PE_BOOL, 0, STR_CONFIG_PATCHES_NOSERVICE, "no_servicing_if_no_breakdowns", &_patches.no_servicing_if_no_breakdowns, 0, 0, 0, NULL},
};
static const PatchEntry _patches_stations[] = {

View File

@ -129,6 +129,7 @@ typedef struct Patches {
bool always_small_airport; // always allow small airports
bool realistic_acceleration; // realistic acceleration for trains
bool invisible_trees; // don't show trees when buildings are transparent
bool no_servicing_if_no_breakdowns; // dont send vehicles to depot when breakdowns are disabled
uint8 toolbar_pos; // position of toolbars, 0=left, 1=center, 2=right
uint8 window_snap_radius; // Windows snap at each other if closer than this

View File

@ -28,6 +28,9 @@ void VehicleServiceInDepot(Vehicle *v)
bool VehicleNeedsService(const Vehicle *v)
{
if (_patches.no_servicing_if_no_breakdowns && _opt.diff.vehicle_breakdowns == 0)
return false;
return _patches.servint_ispercent ?
(v->reliability < _engines[v->engine_type].reliability * (100 - v->service_interval) / 100) :
(v->date_of_last_service + v->service_interval < _date);