mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-03-06 14:27:16 +00:00
(svn r2982) Newgrf: Added patch option for wagon speed limits. This is enabled by default.
This commit is contained in:
parent
47de27ab69
commit
c02b1d555d
@ -1017,6 +1017,7 @@ STR_CONFIG_PATCHES_SERVINT_AIRCRAFT_DISABLED :{LTBLUE}Default
|
||||
STR_CONFIG_PATCHES_SERVINT_SHIPS :{LTBLUE}Default service interval for ships: {ORANGE}{STRING1} 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}{STRING1}
|
||||
STR_CONFIG_PATCHES_WAGONSPEEDLIMITS :{LTBLUE}Enable wagon speed limits: {ORANGE}{STRING1}
|
||||
|
||||
STR_CONFIG_PATCHES_COLORED_NEWS_DATE :{LTBLUE}Coloured news appears in: {ORANGE}{STRING1}
|
||||
STR_CONFIG_PATCHES_STARTING_DATE :{LTBLUE}Starting date: {ORANGE}{STRING1}
|
||||
|
3
newgrf.c
3
newgrf.c
@ -2187,7 +2187,8 @@ static void InitializeGRFSpecial(void)
|
||||
|
||||
_ttdpatch_flags[2] = (1 << 0x0D) /* buildonslopes */
|
||||
| (1 << 0x16) /* canals */
|
||||
| (1 << 0x17); /* newstartyear */
|
||||
| (1 << 0x17) /* newstartyear */
|
||||
| (_patches.wagon_speed_limits ? (1 << 0x1D) : 0); /* wagonspeedlimits */
|
||||
}
|
||||
|
||||
static void InitNewGRFFile(const char* filename, int sprite_offset)
|
||||
|
@ -889,6 +889,7 @@ const SettingDesc patch_settings[] = {
|
||||
{"nonuniform_stations", SDT_BOOL, (void*)true, &_patches.nonuniform_stations, NULL},
|
||||
{"always_small_airport",SDT_BOOL, (void*)false, &_patches.always_small_airport, NULL},
|
||||
{"realistic_acceleration",SDT_BOOL, (void*)false, &_patches.realistic_acceleration, NULL},
|
||||
{"wagon_speed_limits", SDT_BOOL, (void*)true, &_patches.wagon_speed_limits, NULL},
|
||||
{"forbid_90_deg", SDT_BOOL, (void*)false, &_patches.forbid_90_deg, NULL},
|
||||
{"improved_load", SDT_BOOL, (void*)false, &_patches.improved_load, NULL},
|
||||
|
||||
|
@ -721,6 +721,7 @@ static const PatchEntry _patches_vehicles[] = {
|
||||
{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},
|
||||
{PE_BOOL, 0, STR_CONFIG_PATCHES_WAGONSPEEDLIMITS, "wagon_speed_limits", &_patches.wagon_speed_limits, 0, 0, 0, NULL},
|
||||
};
|
||||
|
||||
static const PatchEntry _patches_stations[] = {
|
||||
|
@ -113,8 +113,9 @@ void TrainConsistChanged(Vehicle *v) {
|
||||
}
|
||||
|
||||
// max speed is the minimum of the speed limits of all vehicles in the consist
|
||||
if (rvi_u->max_speed != 0 && !UsesWagonOverride(u))
|
||||
max_speed = min(rvi_u->max_speed, max_speed);
|
||||
if (!(rvi_u->flags & RVI_WAGON) || _patches.wagon_speed_limits)
|
||||
if (rvi_u->max_speed != 0 && !UsesWagonOverride(u))
|
||||
max_speed = min(rvi_u->max_speed, max_speed);
|
||||
|
||||
// check the vehicle length (callback)
|
||||
veh_len = CALLBACK_FAILED;
|
||||
|
@ -111,7 +111,7 @@ void DrawTrainWagonPurchaseInfo(int x, int y, EngineID engine_number)
|
||||
y += 10;
|
||||
|
||||
/* Wagon speed limit, displayed if above zero */
|
||||
if (rvi->max_speed > 0) {
|
||||
if (rvi->max_speed > 0 && _patches.wagon_speed_limits) {
|
||||
SetDParam(0, rvi->max_speed * 10 >> 4);
|
||||
DrawString(x,y, STR_PURCHASE_INFO_SPEED, 0);
|
||||
y += 10;
|
||||
|
@ -115,6 +115,7 @@ typedef struct Patches {
|
||||
bool nonuniform_stations;// allow nonuniform train stations
|
||||
bool always_small_airport; // always allow small airports
|
||||
bool realistic_acceleration; // realistic acceleration for trains
|
||||
bool wagon_speed_limits; // enable wagon speed limits
|
||||
bool forbid_90_deg; // forbid trains to make 90 deg turns
|
||||
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
|
||||
|
Loading…
Reference in New Issue
Block a user