Changeset - r14843:47401053c1ce
[Not reviewed]
master
0 1 0
yexo - 14 years ago 2010-03-18 00:41:16
yexo@openttd.org
(svn r19449) -Codechange: pay for every airport tile build, not for every tile in the rectangle where the airport is build
1 file changed with 5 insertions and 2 deletions:
0 comments (0 inline, 0 general)
src/station_cmd.cpp
Show inline comments
 
@@ -2192,25 +2192,28 @@ CommandCost CmdBuildAirport(TileIndex ti
 
			if (Company::IsValidID(_current_company)) {
 
				SetBit(st->town->have_ratings, _current_company);
 
			}
 
		}
 
	}
 

	
 
	cost.AddCost(_price[PR_BUILD_STATION_AIRPORT] * w * h);
 
	const AirportTileTable *it = as->table[layout];
 
	do {
 
		cost.AddCost(_price[PR_BUILD_STATION_AIRPORT]);
 
	} while ((++it)->ti.x != -0x80);
 

	
 
	if (flags & DC_EXEC) {
 
		/* Always add the noise, so there will be no need to recalculate when option toggles */
 
		nearest->noise_reached += newnoise_level;
 

	
 
		st->AddFacility(FACIL_AIRPORT, tile);
 
		st->airport_type = (byte)p1;
 
		st->airport_flags = 0;
 

	
 
		st->rect.BeforeAddRect(tile, w, h, StationRect::ADD_TRY);
 

	
 
		const AirportTileTable *it = as->table[layout];
 
		it = as->table[layout];
 
		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);
 

	
0 comments (0 inline, 0 general)