Changeset - r11:c7045bf4c614
[Not reviewed]
master
0 8 0
dominik - 20 years ago 2004-08-10 17:06:10
dominik@openttd.org
(svn r12) Change: removed patch no_train_service. Instead you can set the default service interval for any vehicle type to 'disabled'.
8 files changed with 27 insertions and 15 deletions:
0 comments (0 inline, 0 general)
aircraft_cmd.c
Show inline comments
 
@@ -522,12 +522,15 @@ void HandleClickOnAircraft(Vehicle *v)
 
}
 

	
 
static void CheckIfAircraftNeedsService(Vehicle *v)
 
{
 
	Station *st;
 

	
 
	if (_patches.servint_aircraft == 0 && IS_HUMAN_PLAYER(v->owner))
 
		return;
 

	
 
	if (v->date_of_last_service + v->service_interval > _date)
 
		return;
 

	
 
	if (v->vehstatus & VS_STOPPED)
 
		return;
 

	
lang/english.txt
Show inline comments
 
@@ -914,13 +914,12 @@ STR_CONFIG_PATCHES_BUILDONSLOPES		:{LTBL
 
STR_CONFIG_PATCHES_EXTRADYNAMITE		:{LTBLUE}Allow removal of more town-owned roads, bridges, tunnels, etc: {ORANGE}{STRING}
 
STR_CONFIG_PATCHES_MAMMOTHTRAINS		:{LTBLUE}Enable building very long trains: {ORANGE}{STRING}
 
STR_CONFIG_PATCHES_REALISTICACCEL		:{LTBLUE}Enable realistic acceleration for trains: {ORANGE}{STRING}
 
STR_CONFIG_PATCHES_JOINSTATIONS			:{LTBLUE}Join train stations built next to each other: {ORANGE}{STRING}
 
STR_CONFIG_PATCHES_FULLLOADANY			:{LTBLUE}Leave station when any cargo is full, if 'full load': {ORANGE}{STRING}
 
STR_CONFIG_PATCHES_INFLATION				:{LTBLUE}Inflation: {ORANGE}{STRING}
 
STR_CONFIG_PATCHES_NOTRAINSERVICE		:{LTBLUE}No automatic train servicing: {ORANGE}{STRING}
 
STR_CONFIG_PATCHES_SELECTGOODS			:{LTBLUE}Deliver cargo to a station only when there is a demand: {ORANGE}{STRING}
 
STR_CONFIG_PATCHES_LONGBRIDGES			:{LTBLUE}Allow building very long bridges: {ORANGE}{STRING}
 
STR_CONFIG_PATCHES_GOTODEPOT			:{LTBLUE}Allow goto depot orders: {ORANGE}{STRING}
 
STR_CONFIG_PATCHES_BUILDXTRAIND			:{LTBLUE}Allow constructing raw material producing industries: {ORANGE}{STRING}
 
STR_CONFIG_PATCHES_MULTIPINDTOWN		:{LTBLUE}Allow multiple similar industries per town: {ORANGE}{STRING}
 
STR_CONFIG_PATCHES_SAMEINDCLOSE			:{LTBLUE}Industries of the same type can be built close to each other: {ORANGE}{STRING}
 
@@ -935,12 +934,13 @@ STR_CONFIG_PATCHES_NEW_DEPOT_FINDING	:{L
 
STR_CONFIG_PATCHES_NONUNIFORM_STATIONS	:{LTBLUE}Nonuniform stations: {ORANGE}{STRING}
 
STR_CONFIG_PATCHES_NEW_TRAIN_PATHFIND	:{LTBLUE}New algorithm for train pathfinding: {ORANGE}{STRING}
 
STR_CONFIG_PATCHES_BUILD_IN_PAUSE		:{LTBLUE}Build while in pause mode: {ORANGE}{STRING}
 
STR_CONFIG_PATCHES_SMALL_AIRPORTS		:{LTBLUE}Always allow small airports: {ORANGE}{STRING}
 

	
 
STR_CONFIG_PATCHES_LOST_TRAIN_DAYS		:{LTBLUE}A train is lost if no progress is made for: {ORANGE}{STRING} days
 
STR_CONFIG_PATCHES_LOST_TRAIN_DAYS_DISABLED		:{LTBLUE}A train is lost if no progress is made for: {ORANGE}disabled
 
STR_CONFIG_PATCHES_WARN_INCOME_LESS		:{LTBLUE}Warn if a train's income is negative: {ORANGE}{STRING}
 
STR_CONFIG_PATCHES_NEVER_EXPIRE_VEHICLES	:{LTBLUE}Vehicles never expire: {ORANGE}{STRING}
 
STR_CONFIG_AUTORENEW_VEHICLE			:{LTBLUE}Autorenew vehicle when it gets old
 
STR_CONFIG_PATCHES_ERRMSG_DURATION		:{LTBLUE}Duration of error message: {ORANGE}{STRING}
 
STR_CONFIG_PATCHES_SNOWLINE_HEIGHT		:{LTBLUE}Snow line height: {ORANGE}{STRING}
 
STR_CONFIG_PATCHES_STATION_SPREAD		:{LTBLUE}Max station spread: {ORANGE}{STRING}
 
@@ -953,16 +953,20 @@ STR_CONFIG_PATCHES_MAX_SHIPS			:{LTBLUE}
 

	
 
STR_CONFIG_PATCHES_AI_BUILDS_TRAINS		:{LTBLUE}Disable trains for computer: {ORANGE}{STRING}
 
STR_CONFIG_PATCHES_AI_BUILDS_ROADVEH	:{LTBLUE}Disable road vehicles for computer: {ORANGE}{STRING}
 
STR_CONFIG_PATCHES_AI_BUILDS_AIRCRAFT	:{LTBLUE}Disable aircraft for computer: {ORANGE}{STRING}
 
STR_CONFIG_PATCHES_AI_BUILDS_SHIPS		:{LTBLUE}Disable ships for computer: {ORANGE}{STRING}
 

	
 
STR_CONFIG_PATCHES_SERVINT_TRAINS		:{LTBLUE}Default service interval for trains: {ORANGE}{STRING} days
 
STR_CONFIG_PATCHES_SERVINT_ROADVEH		:{LTBLUE}Default service interval for road vehicles: {ORANGE}{STRING} days
 
STR_CONFIG_PATCHES_SERVINT_AIRCRAFT		:{LTBLUE}Default service interval for aircraft: {ORANGE}{STRING} days
 
STR_CONFIG_PATCHES_SERVINT_SHIPS		:{LTBLUE}Default service interval for ships: {ORANGE}{STRING} days
 
STR_CONFIG_PATCHES_SERVINT_TRAINS							:{LTBLUE}Default service interval for trains: {ORANGE}{STRING} days
 
STR_CONFIG_PATCHES_SERVINT_TRAINS_DISABLED		:{LTBLUE}Default service interval for trains: {ORANGE}disabled
 
STR_CONFIG_PATCHES_SERVINT_ROADVEH						:{LTBLUE}Default service interval for road vehicles: {ORANGE}{STRING} days
 
STR_CONFIG_PATCHES_SERVINT_ROADVEH_DISABLED		:{LTBLUE}Default service interval for road vehicles: {ORANGE}disabled
 
STR_CONFIG_PATCHES_SERVINT_AIRCRAFT						:{LTBLUE}Default service interval for aircraft: {ORANGE}{STRING} days
 
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_COLORED_NEWS_DATE	:{LTBLUE}Colored news appears in: {ORANGE}{STRING}
 
STR_CONFIG_PATCHES_STARTING_DATE		:{LTBLUE}Starting date: {ORANGE}{STRING}
 
STR_CONFIG_PATCHES_SMOOTH_ECONOMY		:{LTBLUE}Enable smooth economy (more, smaller changes)
 

	
 
STR_CONFIG_PATCHES_GUI					:{BLACK}Interface
roadveh_cmd.c
Show inline comments
 
@@ -1485,12 +1485,15 @@ void RoadVeh_Tick(Vehicle *v)
 
}
 

	
 
static void CheckIfRoadVehNeedsService(Vehicle *v)
 
{
 
	int i;
 

	
 
	if (_patches.servint_roadveh == 0 && IS_HUMAN_PLAYER(v->owner))
 
		return;
 

	
 
	if (v->date_of_last_service + v->service_interval > _date)
 
		return;
 

	
 
	if (v->vehstatus & VS_STOPPED)
 
		return;
 

	
settings.c
Show inline comments
 
@@ -794,13 +794,12 @@ static const SettingDesc patch_settings[
 
	{"mammoth_trains", SDT_BOOL, (void*)true, (void*)offsetof(Patches, mammoth_trains) },
 
	{"join_stations", SDT_BOOL, (void*)true, (void*)offsetof(Patches, join_stations) },
 
	{"station_spread", SDT_UINT8, (void*)12, (void*)offsetof(Patches, station_spread) },
 
	{"full_load_any", SDT_BOOL, (void*)true, (void*)offsetof(Patches, full_load_any)},
 

	
 
	{"inflation", SDT_BOOL, (void*)true, (void*)offsetof(Patches, inflation)},
 
	{"no_train_service", SDT_BOOL, (void*)false, (void*)offsetof(Patches, no_train_service)},
 
	{"selectgoods", SDT_BOOL, (void*)true, (void*)offsetof(Patches, selectgoods)},
 
	{"longbridges", SDT_BOOL, (void*)false, (void*)offsetof(Patches, longbridges)},
 
	{"gotodepot", SDT_BOOL, (void*)true, (void*)offsetof(Patches, gotodepot)},
 

	
 
	{"build_rawmaterial_ind", SDT_BOOL, (void*)false, (void*)offsetof(Patches, build_rawmaterial_ind)},
 
	{"multiple_industry_per_town", SDT_BOOL, (void*)false, (void*)offsetof(Patches, multiple_industry_per_town)},
settings_gui.c
Show inline comments
 
@@ -695,13 +695,12 @@ static const PatchEntry _patches_constru
 

	
 
};
 

	
 
static const PatchEntry _patches_vehicles[] = {
 
	{PE_BOOL, 0, STR_CONFIG_PATCHES_REALISTICACCEL, &_patches.realistic_acceleration},
 
	{PE_BOOL, 0, STR_CONFIG_PATCHES_MAMMOTHTRAINS, &_patches.mammoth_trains},
 
	{PE_BOOL, 0, STR_CONFIG_PATCHES_NOTRAINSERVICE, &_patches.no_train_service},
 
	{PE_BOOL, 0, STR_CONFIG_PATCHES_GOTODEPOT, &_patches.gotodepot},
 
	{PE_BOOL, 0, STR_CONFIG_PATCHES_ROADVEH_QUEUE, &_patches.roadveh_queue},
 
	{PE_BOOL, 0, STR_CONFIG_PATCHES_NEW_DEPOT_FINDING, &_patches.new_depot_finding},
 
	{PE_BOOL, 0, STR_CONFIG_PATCHES_NEW_TRAIN_PATHFIND, &_patches.new_pathfinding},
 

	
 
	{PE_BOOL, 0, STR_CONFIG_PATCHES_WARN_INCOME_LESS, &_patches.train_income_warn},
 
@@ -712,16 +711,16 @@ static const PatchEntry _patches_vehicle
 

	
 
	{PE_UINT8, 0, STR_CONFIG_PATCHES_MAX_TRAINS, &_patches.max_trains, 0, 240, 10},
 
	{PE_UINT8, 0, STR_CONFIG_PATCHES_MAX_ROADVEH, &_patches.max_roadveh, 0, 240, 10},
 
	{PE_UINT8, 0, STR_CONFIG_PATCHES_MAX_AIRCRAFT, &_patches.max_aircraft, 0, 240, 10},
 
	{PE_UINT8, 0, STR_CONFIG_PATCHES_MAX_SHIPS, &_patches.max_ships, 0, 240, 10},
 

	
 
	{PE_UINT16, 0, STR_CONFIG_PATCHES_SERVINT_TRAINS, &_patches.servint_trains, 0, 1200, 10},
 
	{PE_UINT16, 0, STR_CONFIG_PATCHES_SERVINT_ROADVEH, &_patches.servint_roadveh, 0, 1200, 10},
 
	{PE_UINT16, 0, STR_CONFIG_PATCHES_SERVINT_AIRCRAFT, &_patches.servint_aircraft, 0, 1200, 10},
 
	{PE_UINT16, 0, STR_CONFIG_PATCHES_SERVINT_SHIPS, &_patches.servint_ships, 0, 1200, 10},
 
	{PE_UINT16, PF_0ISDIS, STR_CONFIG_PATCHES_SERVINT_TRAINS, &_patches.servint_trains, 30, 1200, 10},
 
	{PE_UINT16, PF_0ISDIS, STR_CONFIG_PATCHES_SERVINT_ROADVEH, &_patches.servint_roadveh, 30, 1200, 10},
 
	{PE_UINT16, PF_0ISDIS, STR_CONFIG_PATCHES_SERVINT_AIRCRAFT, &_patches.servint_aircraft, 30, 1200, 10},
 
	{PE_UINT16, PF_0ISDIS, STR_CONFIG_PATCHES_SERVINT_SHIPS, &_patches.servint_ships, 30, 1200, 10},
 

	
 
	{PE_BYTE, 0, STR_CONFIG_PATCHES_AI_BUILDS_TRAINS, &_patches.ai_disable_veh, 0x01},
 
	{PE_BYTE, 0, STR_CONFIG_PATCHES_AI_BUILDS_ROADVEH, &_patches.ai_disable_veh, 0x02},
 
	{PE_BYTE, 0, STR_CONFIG_PATCHES_AI_BUILDS_AIRCRAFT, &_patches.ai_disable_veh, 0x04},
 
	{PE_BYTE, 0, STR_CONFIG_PATCHES_AI_BUILDS_SHIPS, &_patches.ai_disable_veh, 0x08},
 
};
 
@@ -811,12 +810,13 @@ static void PatchesSelectionWndProc(Wind
 

	
 
		x = 0;
 
		y = 46;
 
		clk = WP(w,def_d).data_2;
 
		page = &_patches_page[WP(w,def_d).data_1];
 
		for(i=0,pe=page->entries; i!=page->num; i++,pe++) {
 
			bool disabled = false;
 
			if (pe->type == PE_BOOL) {
 
				DrawFrameRect(x+5, y+1, x+15+9, y+9, (*(bool*)pe->variable)?6:4, (*(bool*)pe->variable)?0x20:0);
 
				SET_DPARAM16(0, *(bool*)pe->variable ? STR_CONFIG_PATCHES_ON : STR_CONFIG_PATCHES_OFF);
 
			} else if (pe->type == PE_BYTE) {
 
				bool enabled;
 
				val = ReadPE(pe);
 
@@ -827,20 +827,21 @@ static void PatchesSelectionWndProc(Wind
 
				DrawFrameRect(x+5, y+1, x+5+9, y+9, 3, clk == i*2+1 ? 0x20 : 0);
 
				DrawFrameRect(x+15, y+1, x+15+9, y+9, 3, clk == i*2+2 ? 0x20 : 0);
 
				DrawStringCentered(x+10, y+1, STR_6819, 0);
 
				DrawStringCentered(x+20, y+1, STR_681A, 0);
 

	
 
				val = ReadPE(pe);
 
				if (val == 0 && pe->flags & PF_0ISDIS) {
 
				disabled = ((val == 0) && (pe->flags & PF_0ISDIS));
 
				if (disabled) {
 
					SET_DPARAM16(0, STR_CONFIG_PATCHES_DISABLED);
 
				} else {
 
					SET_DPARAM32(1, val);
 
					SET_DPARAM16(0, pe->flags & PF_NOCOMMA ? STR_CONFIG_PATCHES_INT32 : STR_7024);
 
				}
 
			}
 
			DrawString(30, y+1, pe->str, 0);
 
			DrawString(30, y+1, (pe->str)+disabled, 0);
 
			y += 11;
 
		}
 
		break;
 
	}
 

	
 
	case WE_CLICK:
ship_cmd.c
Show inline comments
 
@@ -82,12 +82,15 @@ static int FindClosestShipDepot(Vehicle 
 
}
 

	
 
static void CheckIfShipNeedsService(Vehicle *v)
 
{
 
	int i;
 

	
 
	if (_patches.servint_ships == 0 && IS_HUMAN_PLAYER(v->owner))
 
		return;
 

	
 
	if (v->date_of_last_service + v->service_interval > _date)
 
		return;
 

	
 
	if (v->vehstatus & VS_STOPPED)
 
		return;
 
	
train_cmd.c
Show inline comments
 
@@ -2500,13 +2500,13 @@ void TrainEnterDepot(Vehicle *v, uint ti
 

	
 
static void CheckIfTrainNeedsService(Vehicle *v)
 
{
 
	uint tile;
 
	byte depot;
 

	
 
	if (_patches.no_train_service && IS_HUMAN_PLAYER(v->owner))
 
	if (_patches.servint_trains == 0 && IS_HUMAN_PLAYER(v->owner))
 
		return;
 

	
 
	if (v->date_of_last_service + v->service_interval > _date)
 
		return;
 

	
 
	if (v->vehstatus & VS_STOPPED)
variables.h
Show inline comments
 
@@ -84,13 +84,12 @@ typedef struct Patches {
 
	bool build_on_slopes;		// allow building on slopes
 
	bool mammoth_trains;		// allow very long trains
 
	bool join_stations;			// allow joining of train stations
 
	bool full_load_any;			// new full load calculation, any cargo must be full
 
	byte station_spread;		// amount a station may spread
 
	bool inflation;					// disable inflation
 
	bool no_train_service;	// never automatically send trains to service
 
	bool selectgoods;       // only send the goods to station if a train has been there
 
	bool longbridges;				// allow 100 tile long bridges
 
	bool gotodepot;					// allow goto depot in orders
 
	bool build_rawmaterial_ind;	 // allow building raw material industries
 
	bool multiple_industry_per_town;	// allow many industries of the same type per town
 
	bool same_industry_close;	// allow same type industries to be built close to each other
0 comments (0 inline, 0 general)