# HG changeset patch # User peter1138 # Date 1204146432 0 # Node ID 3e82211b57c5182c3b813577e4c000a862f5e026 # Parent 594daafabff48a220b5a73519d4c542efaa6ccc4 (svn r12293) -Feature: Ability to change aircraft speed factor, from so called 'realistic' (matching other vehicles) (1/1) to original TTD speed (1/4). Note this option defaults to original TTD speed. diff -r 594daafabff4 -r 3e82211b57c5 src/aircraft_cmd.cpp --- a/src/aircraft_cmd.cpp Wed Feb 27 15:35:24 2008 +0000 +++ b/src/aircraft_cmd.cpp Wed Feb 27 21:07:12 2008 +0000 @@ -924,6 +924,10 @@ uint spd = v->acceleration * 16; byte t; + /* Adjust speed limits by plane speed factor to prevent taxiing + * and take-off speeds being too low. */ + speed_limit *= _patches.plane_speed; + if (v->u.air.cached_max_speed < speed_limit) { if (v->cur_speed < speed_limit) hard_limit = false; speed_limit = v->u.air.cached_max_speed; @@ -939,7 +943,9 @@ * method at slower speeds. This also results in less reduction at slow * speeds to that aircraft do not get to taxi speed straight after * touchdown. */ - if (!hard_limit && v->cur_speed > speed_limit) speed_limit = v->cur_speed - max(1, (v->cur_speed * v->cur_speed) / 16384); + if (!hard_limit && v->cur_speed > speed_limit) { + speed_limit = v->cur_speed - max(1, ((v->cur_speed * v->cur_speed) / 16384) / _patches.plane_speed); + } spd = min(v->cur_speed + (spd >> 8) + (v->subspeed < t), speed_limit); @@ -953,6 +959,9 @@ InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, VVW_WIDGET_START_STOP_VEH); } + /* Adjust distance moved by plane speed setting */ + if (_patches.plane_speed > 1) spd /= _patches.plane_speed; + if (!(v->direction & 1)) spd = spd * 3 / 4; spd += v->progress; diff -r 594daafabff4 -r 3e82211b57c5 src/lang/english.txt --- a/src/lang/english.txt Wed Feb 27 15:35:24 2008 +0000 +++ b/src/lang/english.txt Wed Feb 27 21:07:12 2008 +0000 @@ -1050,6 +1050,7 @@ STR_CONFIG_PATCHES_ALLOW_GIVE_MONEY :{LTBLUE}Allow sending money to other companies: {ORANGE}{STRING1} STR_CONFIG_PATCHES_NONUNIFORM_STATIONS :{LTBLUE}Nonuniform stations: {ORANGE}{STRING1} STR_CONFIG_PATCHES_FREIGHT_TRAINS :{LTBLUE}Weight multiplier for freight to simulate heavy trains: {ORANGE}{STRING} +STR_CONFIG_PATCHES_PLANE_SPEED :{LTBLUE}Plane speed factor: {ORANGE}1 / {STRING1} STR_CONFIG_PATCHES_STOP_ON_TOWN_ROAD :{LTBLUE}Allow drive-through road stops on town owned roads: {ORANGE}{STRING} STR_CONFIG_PATCHES_ADJACENT_STATIONS :{LTBLUE}Allow building adjacent stations: {ORANGE}{STRING} diff -r 594daafabff4 -r 3e82211b57c5 src/saveload.cpp --- a/src/saveload.cpp Wed Feb 27 15:35:24 2008 +0000 +++ b/src/saveload.cpp Wed Feb 27 21:07:12 2008 +0000 @@ -34,7 +34,7 @@ #include "table/strings.h" -extern const uint16 SAVEGAME_VERSION = 89; +extern const uint16 SAVEGAME_VERSION = 90; uint16 _sl_version; ///< the major savegame version identifier byte _sl_minor_version; ///< the minor savegame version, DO NOT USE! diff -r 594daafabff4 -r 3e82211b57c5 src/settings.cpp --- a/src/settings.cpp Wed Feb 27 15:35:24 2008 +0000 +++ b/src/settings.cpp Wed Feb 27 21:07:12 2008 +0000 @@ -1432,6 +1432,7 @@ SDT_CONDBOOL(Patches, disable_elrails, 38, SL_MAX_VERSION, 0, NN, false, STR_CONFIG_PATCHES_DISABLE_ELRAILS, SettingsDisableElrail), SDT_CONDVAR(Patches, freight_trains, SLE_UINT8, 39, SL_MAX_VERSION, 0,NN, 1, 1, 255, 1, STR_CONFIG_PATCHES_FREIGHT_TRAINS, NULL), SDT_CONDBOOL(Patches, timetabling, 67, SL_MAX_VERSION, 0, 0, true, STR_CONFIG_PATCHES_TIMETABLE_ALLOW, NULL), + SDT_CONDVAR(Patches, plane_speed, SLE_UINT8, 90, SL_MAX_VERSION, 0, 0, 4, 1, 4, 0, STR_CONFIG_PATCHES_PLANE_SPEED, NULL), /***************************************************************************/ /* Station section of the GUI-configure patches window */ diff -r 594daafabff4 -r 3e82211b57c5 src/settings_gui.cpp --- a/src/settings_gui.cpp Wed Feb 27 15:35:24 2008 +0000 +++ b/src/settings_gui.cpp Wed Feb 27 21:07:12 2008 +0000 @@ -818,6 +818,7 @@ "wagon_speed_limits", "disable_elrails", "freight_trains", + "plane_speed", "timetabling", }; diff -r 594daafabff4 -r 3e82211b57c5 src/settings_type.h --- a/src/settings_type.h Wed Feb 27 15:35:24 2008 +0000 +++ b/src/settings_type.h Wed Feb 27 21:07:12 2008 +0000 @@ -130,6 +130,8 @@ uint8 pathfinder_for_roadvehs; ///< the pathfinder to use for roadvehicles uint8 pathfinder_for_ships; ///< the pathfinder to use for ships + uint8 plane_speed; ///< divisor for speed of aircraft + bool autorenew; int16 autorenew_months; int32 autorenew_money;