(svn r18942) -Feature [FS#2678]: add a setting to reduce/disable aircraft crashes

pull/155/head
yexo 15 years ago
parent 8972d542e1
commit 06d4f3a0f2

@ -1291,14 +1291,18 @@ static void CrashAirplane(Aircraft *v)
static void MaybeCrashAirplane(Aircraft *v)
{
if (_settings_game.vehicle.plane_crashes == 0) return;
Station *st = Station::Get(v->targetairport);
/* FIXME -- MaybeCrashAirplane -> increase crashing chances of very modern airplanes on smaller than AT_METROPOLITAN airports */
uint16 prob = 0x10000 / 1500;
uint32 prob = (0x40000 >> _settings_game.vehicle.plane_crashes);
if ((st->Airport()->flags & AirportFTAClass::SHORT_STRIP) &&
(AircraftVehInfo(v->engine_type)->subtype & AIR_FAST) &&
!_cheats.no_jetcrash.value) {
prob = 0x10000 / 20;
prob /= 20;
} else {
prob /= 1500;
}
if (GB(Random(), 0, 22) > prob) return;

@ -1115,6 +1115,10 @@ STR_CONFIG_SETTING_ALLOW_GIVE_MONEY :{LTBLUE}Allow s
STR_CONFIG_SETTING_NONUNIFORM_STATIONS :{LTBLUE}Nonuniform stations: {ORANGE}{STRING1}
STR_CONFIG_SETTING_FREIGHT_TRAINS :{LTBLUE}Weight multiplier for freight to simulate heavy trains: {ORANGE}{STRING}
STR_CONFIG_SETTING_PLANE_SPEED :{LTBLUE}Plane speed factor: {ORANGE}1 / {STRING1}
STR_CONFIG_SETTING_PLANE_CRASHES :{LTBLUE}Number of plane crashes: {ORANGE}{STRING1}
STR_CONFIG_SETTING_PLANE_CRASHES_NONE :none
STR_CONFIG_SETTING_PLANE_CRASHES_REDUCED :reduced
STR_CONFIG_SETTING_PLANE_CRASHES_NORMAL :normal
STR_CONFIG_SETTING_STOP_ON_TOWN_ROAD :{LTBLUE}Allow drive-through road stops on town owned roads: {ORANGE}{STRING}
STR_CONFIG_SETTING_STOP_ON_COMPETITOR_ROAD :{LTBLUE}Allow drive-through road stops on roads owned by competitors: {ORANGE}{STRING}
STR_CONFIG_SETTING_ADJACENT_STATIONS :{LTBLUE}Allow building adjacent stations: {ORANGE}{STRING}

@ -46,7 +46,7 @@
#include "saveload_internal.h"
extern const uint16 SAVEGAME_VERSION = 137;
extern const uint16 SAVEGAME_VERSION = 138;
SavegameType _savegame_type; ///< type of savegame we are loading

@ -1458,6 +1458,7 @@ static SettingEntry _settings_vehicles[] = {
SettingEntry("vehicle.max_aircraft"),
SettingEntry("vehicle.max_ships"),
SettingEntry("vehicle.plane_speed"),
SettingEntry("vehicle.plane_crashes"),
SettingEntry("order.timetabling"),
SettingEntry("vehicle.dynamic_engines"),
};

@ -320,6 +320,7 @@ struct VehicleSettings {
bool never_expire_vehicles; ///< never expire vehicles
byte extend_vehicle_life; ///< extend vehicle life by this many years
byte road_side; ///< the side of the road vehicles drive on
uint8 plane_crashes; ///< number of plane crashes, 0 = none, 1 = reduced, 2 = normal
};
/** Settings related to the economy. */

@ -402,6 +402,7 @@ const SettingDesc _settings[] = {
SDT_CONDBOOL(GameSettings, order.timetabling, 67, SL_MAX_VERSION, 0, 0, true, STR_CONFIG_SETTING_TIMETABLE_ALLOW, NULL),
SDT_CONDVAR(GameSettings, vehicle.plane_speed, SLE_UINT8, 90, SL_MAX_VERSION, 0,NN, 4, 1, 4, 0, STR_CONFIG_SETTING_PLANE_SPEED, NULL),
SDT_CONDBOOL(GameSettings, vehicle.dynamic_engines, 95, SL_MAX_VERSION, 0,NN, true, STR_CONFIG_SETTING_DYNAMIC_ENGINES, ChangeDynamicEngines),
SDT_CONDVAR(GameSettings, vehicle.plane_crashes, SLE_UINT8,138, SL_MAX_VERSION, 0,MS, 2, 0, 2, 1, STR_CONFIG_SETTING_PLANE_CRASHES, NULL),
SDT_BOOL(GameSettings, station.join_stations, 0, 0, true, STR_CONFIG_SETTING_JOINSTATIONS, NULL),
SDTC_CONDBOOL( gui.sg_full_load_any, 22, 92, 0, 0, true, STR_NULL, NULL),

Loading…
Cancel
Save