From e21302f4811ec62a6d6abfa89ad34afba4a3ab4a Mon Sep 17 00:00:00 2001 From: Charles Pigott Date: Mon, 28 Dec 2020 10:26:57 +0000 Subject: Fix #8437: Crash when using certain heliports with rotated airports --- src/aircraft_cmd.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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. */ -- cgit v1.2.3-54-g00ecf