diff options
author | yexo <yexo@openttd.org> | 2010-01-28 22:34:14 +0000 |
---|---|---|
committer | yexo <yexo@openttd.org> | 2010-01-28 22:34:14 +0000 |
commit | fa01b25f740d92ffa74de4bc630ca42cdc8046a0 (patch) | |
tree | 2ec72945b9470a3a579f97ea489790e5b9690146 /src/aircraft_cmd.cpp | |
parent | b689e3d6e43f5e5d90d0c2c93059cce5d48459ae (diff) | |
download | openttd-fa01b25f740d92ffa74de4bc630ca42cdc8046a0.tar.xz |
(svn r18942) -Feature [FS#2678]: add a setting to reduce/disable aircraft crashes
Diffstat (limited to 'src/aircraft_cmd.cpp')
-rw-r--r-- | src/aircraft_cmd.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/aircraft_cmd.cpp b/src/aircraft_cmd.cpp index d2b85ed1a..12c182975 100644 --- a/src/aircraft_cmd.cpp +++ b/src/aircraft_cmd.cpp @@ -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; |