diff options
author | yexo <yexo@openttd.org> | 2009-09-09 00:03:35 +0000 |
---|---|---|
committer | yexo <yexo@openttd.org> | 2009-09-09 00:03:35 +0000 |
commit | e2122dc7f0e02e50ff2e17ae2d3a164671aa0975 (patch) | |
tree | 93ad200736bf53ed27b160b07de3798386983448 /src/aircraft_cmd.cpp | |
parent | 4924e4ffba7a956641272e2408f27cfb5b023d2a (diff) | |
download | openttd-e2122dc7f0e02e50ff2e17ae2d3a164671aa0975.tar.xz |
(svn r17483) -Fix (r17405): when an aircraft starts flying in circles make it turn in the correct direction first before continuing
Diffstat (limited to 'src/aircraft_cmd.cpp')
-rw-r--r-- | src/aircraft_cmd.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/aircraft_cmd.cpp b/src/aircraft_cmd.cpp index cb38121d2..44d0b95c0 100644 --- a/src/aircraft_cmd.cpp +++ b/src/aircraft_cmd.cpp @@ -1071,9 +1071,14 @@ static bool AircraftController(Aircraft *v) /* Turn. Do it slowly if in the air. */ Direction newdir = GetDirectionTowards(v, x + amd->x, y + amd->y); if (newdir != v->direction) { - if (amd->flag & AMED_SLOWTURN) { + if (amd->flag & AMED_SLOWTURN && v->number_consecutive_turns < 8) { if (v->load_unload_time_rem == 0 || newdir == v->last_direction) { - v->load_unload_time_rem = 1 << (_settings_game.vehicle.plane_speed - 1); + if (newdir == v->last_direction) { + v->number_consecutive_turns = 0; + } else { + v->number_consecutive_turns++; + } + v->load_unload_time_rem = 2 * _settings_game.vehicle.plane_speed; v->last_direction = v->direction; v->direction = newdir; } @@ -1094,6 +1099,7 @@ static bool AircraftController(Aircraft *v) gp.new_tile = gp.old_tile = v->tile; } } else { + v->number_consecutive_turns = 0; /* Move vehicle. */ gp = GetNewVehiclePos(v); } |