diff --git a/src/lang/english.txt b/src/lang/english.txt index c8a1df9e74..9e32d49cb4 100644 --- a/src/lang/english.txt +++ b/src/lang/english.txt @@ -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 diff --git a/src/settings_gui.cpp b/src/settings_gui.cpp index 15212d0b27..aa88b35c0b 100644 --- a/src/settings_gui.cpp +++ b/src/settings_gui.cpp @@ -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)); diff --git a/src/settings_type.h b/src/settings_type.h index fba0f299ec..7e799e2793 100644 --- a/src/settings_type.h +++ b/src/settings_type.h @@ -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. */ diff --git a/src/table/settings.ini b/src/table/settings.ini index 1644f0b18a..785de1e197 100644 --- a/src/table/settings.ini +++ b/src/table/settings.ini @@ -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 diff --git a/src/train_cmd.cpp b/src/train_cmd.cpp index 7afb64d9df..23df59c04a 100644 --- a/src/train_cmd.cpp +++ b/src/train_cmd.cpp @@ -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 */