Changeset - r1037:e6afad772171
[Not reviewed]
master
0 5 0
darkvater - 19 years ago 2005-01-16 12:29:52
darkvater@openttd.org
(svn r1538) -Feature: [988816] Disable servicing when breakdowns set to none (jaguar7)
5 files changed with 8 insertions and 1 deletions:
0 comments (0 inline, 0 general)
lang/english.txt
Show inline comments
 
@@ -1044,6 +1044,7 @@ STR_CONFIG_PATCHES_SERVINT_AIRCRAFT				:
 
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 Vehicle
 

	
 
############ End of list of rail types
 

	
 
STR_TINY_BLACK							:{BLACK}{TINYFONT}{COMMA16}
 
\ No newline at end of file
 
STR_TINY_BLACK							:{BLACK}{TINYFONT}{COMMA16}
settings.c
Show inline comments
 
@@ -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},
settings_gui.c
Show inline comments
 
@@ -660,6 +660,7 @@ static const PatchEntry _patches_vehicle
 
	{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[] = {
variables.h
Show inline comments
 
@@ -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
vehicle.c
Show inline comments
 
@@ -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);
0 comments (0 inline, 0 general)