summaryrefslogtreecommitdiff
path: root/src/aircraft_cmd.cpp
diff options
context:
space:
mode:
authoryexo <yexo@openttd.org>2010-08-05 12:03:06 +0000
committeryexo <yexo@openttd.org>2010-08-05 12:03:06 +0000
commit7e4bdbbc9dd9c7a4bb8f6c0af569aafece9d1443 (patch)
tree586a636c068b978b7ad38a6a2bf2b9f846214906 /src/aircraft_cmd.cpp
parentc421b6fef59027a222340f2647d2f370f165f809 (diff)
downloadopenttd-7e4bdbbc9dd9c7a4bb8f6c0af569aafece9d1443.tar.xz
(svn r20368) -Codechange: automatically rotate all nodes for airport movement if the airport is rotated
Diffstat (limited to 'src/aircraft_cmd.cpp')
-rw-r--r--src/aircraft_cmd.cpp13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/aircraft_cmd.cpp b/src/aircraft_cmd.cpp
index f2d2f8f09..6ca9f1ddd 100644
--- a/src/aircraft_cmd.cpp
+++ b/src/aircraft_cmd.cpp
@@ -855,8 +855,17 @@ static bool AircraftController(Aircraft *v)
const Station *st = Station::GetIfValid(v->targetairport);
/* INVALID_TILE if there is no station */
TileIndex tile = INVALID_TILE;
+ Direction rotation = DIR_N;
+ uint size_x = 1, size_y = 1;
if (st != NULL) {
- tile = (st->airport.tile != INVALID_TILE) ? st->airport.tile : st->xy;
+ if (st->airport.tile != INVALID_TILE) {
+ tile = st->airport.tile;
+ rotation = st->airport.rotation;
+ size_x = st->airport.w;
+ size_y = st->airport.h;
+ } else {
+ tile = st->xy;
+ }
}
/* DUMMY if there is no station or no airport */
const AirportFTAClass *afc = tile == INVALID_TILE ? GetAirport(AT_DUMMY) : st->airport.GetFTA();
@@ -878,7 +887,7 @@ static bool AircraftController(Aircraft *v)
}
/* get airport moving data */
- const AirportMovingData amd = *afc->MovingData(v->pos);
+ const AirportMovingData amd = RotateAirportMovingData(afc->MovingData(v->pos), rotation, size_x, size_y);
int x = TileX(tile) * TILE_SIZE;
int y = TileY(tile) * TILE_SIZE;