Changeset - r14614:1e3fc4aa74ab
[Not reviewed]
master
0 2 0
yexo - 15 years ago 2010-02-22 14:17:33
yexo@openttd.org
(svn r19201) -Codechange: airport tiles now have 4 random bits per tile.
2 files changed with 9 insertions and 1 deletions:
0 comments (0 inline, 0 general)
src/newgrf_airporttiles.cpp
Show inline comments
 
@@ -207,9 +207,16 @@ static uint32 AirportTileGetVariable(con
 
	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;
src/station_cmd.cpp
Show inline comments
 
@@ -2076,6 +2076,7 @@ CommandCost CmdBuildAirport(TileIndex ti
 
		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);
0 comments (0 inline, 0 general)