summaryrefslogtreecommitdiff
path: root/src/aircraft_cmd.cpp
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 /src/aircraft_cmd.cpp
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)
Diffstat (limited to 'src/aircraft_cmd.cpp')
-rw-r--r--src/aircraft_cmd.cpp9
1 files changed, 4 insertions, 5 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;