Add setting to enable flipping direction of all train types in depot

pull/73/head
Jonathan G Rennison 6 years ago
parent ce6d6db4d5
commit ce4e2ca3c3

@ -1278,6 +1278,9 @@ STR_CONFIG_SETTING_CHUNNEL_HELPTEXT :When enabled, t
STR_CONFIG_SETTING_NO_TRAIN_CRASH_OTHER_COMPANY :Trains from different companies may not crash into each other: {STRING2}
STR_CONFIG_SETTING_NO_TRAIN_CRASH_OTHER_COMPANY_HELPTEXT :This setting is primarily to prevent untrusted players deliberately causing crashes involving other companies' trains in multi-player rail infrastructure sharing games.
STR_CONFIG_SETTING_FLIP_DIRECTION_ALL_TRAINS :All train vehicles may be direction flipped in depot: {STRING2}
STR_CONFIG_SETTING_FLIP_DIRECTION_ALL_TRAINS_HELPTEXT :Enable flipping the direction of all train vehicles in depots, even if it is not enabled by the NewGRF.
STR_CONFIG_SETTING_NEVER_EXPIRE_AIRPORTS :Airports never expire: {STRING2}
STR_CONFIG_SETTING_NEVER_EXPIRE_AIRPORTS_HELPTEXT :Enabling this setting makes each airport type stay available forever after its introduction

@ -1714,6 +1714,7 @@ static SettingsContainer &GetSettingsTree()
vehicles->Add(new SettingEntry("order.serviceathelipad"));
vehicles->Add(new SettingEntry("vehicle.adjacent_crossings"));
vehicles->Add(new SettingEntry("vehicle.safer_crossings"));
vehicles->Add(new SettingEntry("vehicle.flip_direction_all_trains"));
}
SettingsPage *limitations = main->Add(new SettingsPage(STR_CONFIG_SETTING_LIMITATIONS));

@ -541,6 +541,7 @@ struct VehicleSettings {
uint8 repair_cost; ///< cost of repairing vehicle
bool ship_collision_avoidance; ///< ships try to avoid colliding with each other
bool no_train_crash_other_company; ///< trains cannot crash with trains from other companies
bool flip_direction_all_trains; ///< enable flipping direction in depot for all train engine types
};
/** Settings related to the economy. */

@ -1336,6 +1336,15 @@ strhelp = STR_CONFIG_SETTING_NO_TRAIN_CRASH_OTHER_COMPANY_HELPTEXT
extver = SlXvFeatureTest(XSLFTO_AND, XSLFI_INFRA_SHARING)
patxname = ""infra_sharing.vehicle.no_train_crash_other_company""
[SDT_BOOL]
base = GameSettings
var = vehicle.flip_direction_all_trains
def = false
str = STR_CONFIG_SETTING_FLIP_DIRECTION_ALL_TRAINS
strhelp = STR_CONFIG_SETTING_FLIP_DIRECTION_ALL_TRAINS_HELPTEXT
patxname = ""flip_direction_all_trains.vehicle.flip_direction_all_trains""
cat = SC_EXPERT
; station.join_stations
[SDT_NULL]
length = 1

@ -2254,7 +2254,7 @@ CommandCost CmdReverseTrainDirection(TileIndex tile, DoCommandFlag flags, uint32
if (v->IsMultiheaded() || HasBit(EngInfo(v->engine_type)->callback_mask, CBM_VEHICLE_ARTIC_ENGINE)) {
return_cmd_error(STR_ERROR_CAN_T_REVERSE_DIRECTION_RAIL_VEHICLE_MULTIPLE_UNITS);
}
if (!HasBit(EngInfo(v->engine_type)->misc_flags, EF_RAIL_FLIPS)) return CMD_ERROR;
if (!HasBit(EngInfo(v->engine_type)->misc_flags, EF_RAIL_FLIPS) && !_settings_game.vehicle.flip_direction_all_trains) return CMD_ERROR;
Train *front = v->First();
/* make sure the vehicle is stopped in the depot */

Loading…
Cancel
Save