diff options
author | peter1138 <peter1138@openttd.org> | 2008-02-15 13:28:13 +0000 |
---|---|---|
committer | peter1138 <peter1138@openttd.org> | 2008-02-15 13:28:13 +0000 |
commit | a141442ff71e6f9135a7ced849a08125058b538c (patch) | |
tree | 7bdbf58e83648931f13058b91c5b16ca6e50b3ae | |
parent | 359771c4065ece92c22c4f18285d457b3ab07de8 (diff) | |
download | openttd-a141442ff71e6f9135a7ced849a08125058b538c.tar.xz |
(svn r12144) -Codechange: Adjust aircraft slowing algorithm so that very fast
aircraft slow down more rapidly than slower aircraft. This prevents them
from reaching the end of the runway at high speed, and also stops slow
aircraft from slowing down too much at the start of the runway.
-rw-r--r-- | src/aircraft_cmd.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/aircraft_cmd.cpp b/src/aircraft_cmd.cpp index 494b041f2..81f2fc685 100644 --- a/src/aircraft_cmd.cpp +++ b/src/aircraft_cmd.cpp @@ -933,7 +933,13 @@ static int UpdateAircraftSpeed(Vehicle *v, uint speed_limit = SPEED_LIMIT_NONE, v->subspeed = (t=v->subspeed) + (byte)spd; - if (!hard_limit && v->cur_speed > speed_limit) speed_limit = v->cur_speed - (v->cur_speed / 48); + /* Aircraft's current speed is used twice so that very fast planes are + * forced to slow down rapidly in the short distance needed. The magic + * value 16384 was determined to give similar results to the old speed/48 + * 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); spd = min(v->cur_speed + (spd >> 8) + (v->subspeed < t), speed_limit); |