summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCharles Pigott <charlespigott@googlemail.com>2020-12-28 10:26:57 +0000
committerPatric Stout <github@truebrain.nl>2021-01-05 11:42:51 +0100
commite21302f4811ec62a6d6abfa89ad34afba4a3ab4a (patch)
tree2a84c28b57f8f87b37a7677f4b5286e8afec064d
parent619d714923b0f8119afc9d3e1402fb1feeecb586 (diff)
downloadopenttd-e21302f4811ec62a6d6abfa89ad34afba4a3ab4a.tar.xz
Fix #8437: Crash when using certain heliports with rotated airports
-rw-r--r--src/aircraft_cmd.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/aircraft_cmd.cpp b/src/aircraft_cmd.cpp
index 10bdeddf4..e03bf1bdf 100644
--- a/src/aircraft_cmd.cpp
+++ b/src/aircraft_cmd.cpp
@@ -949,7 +949,14 @@ static bool AircraftController(Aircraft *v)
return false;
}
- /* Vehicle is now at the airport. */
+ /* Vehicle is now at the airport.
+ * Helicopter has arrived at the target landing pad, so the current position is also where it should land.
+ * Except for Oilrigs which are special due to being a 1x1 station, and helicopters land outside it. */
+ if (st->airport.type != AT_OILRIG) {
+ x = v->x_pos;
+ y = v->y_pos;
+ tile = TileVirtXY(x, y);
+ }
v->tile = tile;
/* Find altitude of landing position. */