summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes E. Krause <j.k@eclipso.de>2019-03-01 00:23:18 +0100
committerPatric Stout <truebrain@openttd.org>2019-03-03 20:59:59 +0100
commit3c94bddbc221a604dab184f6f1133764bfef03e1 (patch)
treeb2737805f458a94b90ed7d9587881b67ed7307cd
parent3f327116db615a902c0ddf149fd35d031955fcfa (diff)
downloadopenttd-3c94bddbc221a604dab184f6f1133764bfef03e1.tar.xz
Change: make crash chance at short runway independent of plane crash rate setting (there's a cheat for this)
-rw-r--r--src/aircraft_cmd.cpp9
-rw-r--r--src/lang/english.txt4
2 files changed, 6 insertions, 7 deletions
diff --git a/src/aircraft_cmd.cpp b/src/aircraft_cmd.cpp
index 7c3566372..b08cb188d 100644
--- a/src/aircraft_cmd.cpp
+++ b/src/aircraft_cmd.cpp
@@ -1309,18 +1309,17 @@ 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 */
- uint32 prob = (0x4000 << _settings_game.vehicle.plane_crashes);
+ uint32 prob;
if ((st->airport.GetFTA()->flags & AirportFTAClass::SHORT_STRIP) &&
(AircraftVehInfo(v->engine_type)->subtype & AIR_FAST) &&
!_cheats.no_jetcrash.value) {
- prob /= 20;
+ prob = 3276;
} else {
- prob /= 1500;
+ if (_settings_game.vehicle.plane_crashes == 0) return;
+ prob = (0x4000 << _settings_game.vehicle.plane_crashes) / 1500;
}
if (GB(Random(), 0, 22) > prob) return;
diff --git a/src/lang/english.txt b/src/lang/english.txt
index 5602094ee..c131fdabd 100644
--- a/src/lang/english.txt
+++ b/src/lang/english.txt
@@ -1257,8 +1257,8 @@ STR_CONFIG_SETTING_PLANE_SPEED :Plane speed fac
STR_CONFIG_SETTING_PLANE_SPEED_HELPTEXT :Set the relative speed of planes compared to other vehicle types, to reduce the amount of income of transport by aircraft
STR_CONFIG_SETTING_PLANE_SPEED_VALUE :1 / {COMMA}
STR_CONFIG_SETTING_PLANE_CRASHES :Number of plane crashes: {STRING2}
-STR_CONFIG_SETTING_PLANE_CRASHES_HELPTEXT :Set the chance of an aircraft crash happening
-STR_CONFIG_SETTING_PLANE_CRASHES_NONE :None
+STR_CONFIG_SETTING_PLANE_CRASHES_HELPTEXT :Set the chance of a random aircraft crash happening.{}* Large airplanes always have a risk of crashing when landing on small airports
+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 :Allow drive-through road stops on town owned roads: {STRING2}