(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.
pull/155/head
peter1138 16 years ago
parent 2678c4faaa
commit 015cf7e6a2

@ -924,6 +924,10 @@ static int UpdateAircraftSpeed(Vehicle *v, uint speed_limit = SPEED_LIMIT_NONE,
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 @@ static int UpdateAircraftSpeed(Vehicle *v, uint speed_limit = SPEED_LIMIT_NONE,
* 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 @@ static int UpdateAircraftSpeed(Vehicle *v, uint speed_limit = SPEED_LIMIT_NONE,
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;

@ -1050,6 +1050,7 @@ STR_CONFIG_PATCHES_ALLOW_EXCLUSIVE :{LTBLUE}Allow b
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}

@ -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!

@ -1432,6 +1432,7 @@ const SettingDesc _patch_settings[] = {
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 */

@ -818,6 +818,7 @@ static const char *_patches_vehicles[] = {
"wagon_speed_limits",
"disable_elrails",
"freight_trains",
"plane_speed",
"timetabling",
};

@ -130,6 +130,8 @@ struct Patches {
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;

Loading…
Cancel
Save