From 6522351a1f66d45eea213560b820d7ad09538d45 Mon Sep 17 00:00:00 2001 From: EmperorJake <68182631+EmperorJake@users.noreply.github.com> Date: Thu, 4 Jan 2024 23:03:11 +1100 Subject: [PATCH] Feature: Setting to disable the loading speed penalty for trains longer than the station --- .DS_Store | Bin 0 -> 8196 bytes src/economy.cpp | 2 +- src/lang/english.txt | 3 +++ src/settings_gui.cpp | 1 + src/settings_type.h | 1 + src/table/settings/game_settings.ini | 7 +++++++ 6 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 .DS_Store diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..b179567118f04d786067ad30991c86cf3f0e7835 GIT binary patch literal 8196 zcmeHMU2GIp6u#fIg&8`~0a{zIBbzQnz!qu?cKJ)Tf69N6ZRxfYmf4+=4oqjt&g>Q} zHI0c6qG){5_!oWhhscA97+-u)6n#`Q!5AMf8h;)%(HE5m&&-_#+QNg0F^Y4Oxo6Hf z_uM<@-0$4kGs_r5M?t@nu{y?>NS9BQO6soDe7%3oXhJ9{CknD>%*c+pqgl(z&KMgB zq6kD0h$0Y0Ac{Z~fqzE?=$-91@dodGu8sOA0#OA1ml5#KhZtQxO@?%m)8Oc!E+_$r z`XxZn=$`6;z$O;bWJo7D4NPfHUOgZ*MOb2ho0C4~4=0)o=_IGzoPnD&gexPgP!Oz6 zcClbMLz2^|k0KC7U}gmT^r>JuHo`P^cuM_#HalvWuGifBIfSzEidnNoQLGgArG}lc zl&5(Gw?oVC^|@Zhv9hImExX4w#xhEEr(=7XX&d>#z|;*IGSqL{x--_{6l~oMY*Snz zN|KaOYRAVDiN@HPMC(LjYBLlr zEVtOnKS-3NN)CNda!8s}DbH2=(*uL@P)1o$q$lqg^-RZh_ZWGXXhx}W$-^x<$KI7U ze0_h;u?i!$n^ETHG%HuIG|y*T%8 zV6u#&6kKDsL35c!ql;#A(!y9MZ_L!a;r^oOnpw-}wY3pLnvX{5LRHdbb7cQj_$9bi^>_AhgM&vHmG}jO=sSqUJngcsCUS{F8LrT z8XveyZkBrw69y#3<&su;t=ea4S;LYPov)LS*Q@DqNY@L_S?qAE3|_KC_TB5jdr7fr%FZ7YYr7*D#*!S2M9EBP+POPj?59Zzz-|M^U1 zEv$=eX9rlGjkA;NDRzpz$LM@S2ra7b{3QSOjXO16C^2SfQW zqSu@rlx*SGKjHNCldb-q&0Dt0+y67kc5z;iUez_X)W(*rT)if-sr?EJIc`f(y*2>? z)KAHk0QCVXrXlu1kcaYZOG=4%H5GYk_EEYRM@2ttmD%Cw_)?M5MX3nc@wke9u}ewx1*WR-GR;68Q?pGKI}&Z2atu15!i5Wgpht56LdPDsNkk zeUPLjtype == VEH_TRAIN) { + if (front->type == VEH_TRAIN && _settings_game.order.station_length_loading_penalty) { /* Each platform tile is worth 2 rail vehicles. */ int overhang = front->GetGroundVehicleCache()->cached_total_length - st->GetPlatformLength(front->tile) * TILE_SIZE; if (overhang > 0) { diff --git a/src/lang/english.txt b/src/lang/english.txt index 7c1c6ae2e6..09aac5258a 100644 --- a/src/lang/english.txt +++ b/src/lang/english.txt @@ -1777,6 +1777,9 @@ STR_CONFIG_SETTING_SERVINT_DISABLED :Disabled STR_CONFIG_SETTING_NOSERVICE :Disable servicing when breakdowns set to none: {STRING2} STR_CONFIG_SETTING_NOSERVICE_HELPTEXT :When enabled, vehicles do not get serviced if they cannot break down +STR_CONFIG_SETTING_STATION_LENGTH_LOADING_PENALTY :Loading speed penalty for trains that are longer than the station: {STRING2} +STR_CONFIG_SETTING_STATION_LENGTH_LOADING_PENALTY_HELPTEXT :When enabled, trains which are too long for the station load more slowly than a train which fits the station. This setting does not affect pathfinding. + STR_CONFIG_SETTING_WAGONSPEEDLIMITS :Enable wagon speed limits: {STRING2} STR_CONFIG_SETTING_WAGONSPEEDLIMITS_HELPTEXT :When enabled, also use speed limits of wagons for deciding the maximum speed of a train diff --git a/src/settings_gui.cpp b/src/settings_gui.cpp index 47b2bf833b..23f0000189 100644 --- a/src/settings_gui.cpp +++ b/src/settings_gui.cpp @@ -1918,6 +1918,7 @@ static SettingsContainer &GetSettingsTree() limitations->Add(new SettingEntry("construction.road_stop_on_competitor_road")); limitations->Add(new SettingEntry("construction.crossing_with_competitor")); limitations->Add(new SettingEntry("vehicle.disable_elrails")); + limitations->Add(new SettingEntry("order.station_length_loading_penalty")); } SettingsPage *disasters = main->Add(new SettingsPage(STR_CONFIG_SETTING_ACCIDENTS)); diff --git a/src/settings_type.h b/src/settings_type.h index 8ac229ed72..8e9c40e3f1 100644 --- a/src/settings_type.h +++ b/src/settings_type.h @@ -501,6 +501,7 @@ struct OrderSettings { bool selectgoods; ///< only send the goods to station if a train has been there bool no_servicing_if_no_breakdowns; ///< don't send vehicles to depot when breakdowns are disabled bool serviceathelipad; ///< service helicopters at helipads automatically (no need to send to depot) + bool station_length_loading_penalty; ///< make trains longer than the station load more slowly }; /** Settings related to vehicles. */ diff --git a/src/table/settings/game_settings.ini b/src/table/settings/game_settings.ini index 7c4fdf51c9..7902d17a4c 100644 --- a/src/table/settings/game_settings.ini +++ b/src/table/settings/game_settings.ini @@ -78,6 +78,13 @@ str = STR_CONFIG_SETTING_SERVICEATHELIPAD strhelp = STR_CONFIG_SETTING_SERVICEATHELIPAD_HELPTEXT cat = SC_EXPERT +[SDT_BOOL] +var = order.station_length_loading_penalty +def = true +str = STR_CONFIG_SETTING_STATION_LENGTH_LOADING_PENALTY +strhelp = STR_CONFIG_SETTING_STATION_LENGTH_LOADING_PENALTY_HELPTEXT +cat = SC_EXPERT + [SDT_BOOL] var = order.gradual_loading from = SLV_40