summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/newgrf_airporttiles.cpp9
-rw-r--r--src/station_cmd.cpp1
2 files changed, 9 insertions, 1 deletions
diff --git a/src/newgrf_airporttiles.cpp b/src/newgrf_airporttiles.cpp
index 1b2d78216..ef1bc90d9 100644
--- a/src/newgrf_airporttiles.cpp
+++ b/src/newgrf_airporttiles.cpp
@@ -207,9 +207,16 @@ static uint32 AirportTileGetVariable(const ResolverObject *object, byte variable
return UINT_MAX;
}
+static uint32 AirportTileGetRandomBits(const ResolverObject *object)
+{
+ const Station *st = object->u.airport.st;
+ const TileIndex tile = object->u.airport.tile;
+ return (st == NULL ? 0 : st->random_bits) | (tile == INVALID_TILE ? 0 : GetStationTileRandomBits(tile) << 16);
+}
+
static void AirportTileResolver(ResolverObject *res, StationGfx gfx, TileIndex tile, Station *st)
{
- res->GetRandomBits = NULL;
+ res->GetRandomBits = AirportTileGetRandomBits;
res->GetTriggers = NULL;
res->SetTriggers = NULL;
res->GetVariable = AirportTileGetVariable;
diff --git a/src/station_cmd.cpp b/src/station_cmd.cpp
index ad0eaa4a6..6409fac44 100644
--- a/src/station_cmd.cpp
+++ b/src/station_cmd.cpp
@@ -2076,6 +2076,7 @@ CommandCost CmdBuildAirport(TileIndex tile, DoCommandFlag flags, uint32 p1, uint
do {
TileIndex cur_tile = tile + ToTileIndexDiff(it->ti);
MakeAirport(cur_tile, st->owner, st->index, it->gfx);
+ SetStationTileRandomBits(cur_tile, GB(Random(), 0, 4));
st->airport.Add(cur_tile);
if (AirportTileSpec::Get(GetTranslatedAirportTileID(it->gfx))->animation_info != 0xFFFF) AddAnimatedTile(cur_tile);