changeset 14306:3fea4122564d draft

(svn r18858) -Codechange: use IsAirportTile where possible
author yexo <yexo@openttd.org>
date Mon, 18 Jan 2010 12:36:08 +0000
parents d6d98b4d1605
children f0ad75f914d1
files src/disaster_cmd.cpp src/water_cmd.cpp
diffstat 2 files changed, 5 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/src/disaster_cmd.cpp
+++ b/src/disaster_cmd.cpp
@@ -209,9 +209,7 @@
 			if (GB(v->tick_counter, 0, 3) == 0) CreateEffectVehicleRel(v, 0, -17, 2, EV_SMOKE);
 
 		} else if (v->current_order.GetDestination() == 0) {
-			if (IsValidTile(v->tile) &&
-					IsTileType(v->tile, MP_STATION) &&
-					IsAirport(v->tile)) {
+			if (IsValidTile(v->tile) && IsAirportTile(v->tile)) {
 				v->current_order.SetDestination(1);
 				v->age = 0;
 
@@ -234,9 +232,7 @@
 	if (v->current_order.GetDestination() > 2) {
 		if (++v->age <= 13320) return true;
 
-		if (IsValidTile(v->tile) &&
-				IsTileType(v->tile, MP_STATION) &&
-				IsAirport(v->tile)) {
+		if (IsValidTile(v->tile) && IsAirportTile(v->tile)) {
 			Station *st = Station::GetByTile(v->tile);
 			CLRBITS(st->airport_flags, RUNWAY_IN_block);
 			AI::NewEvent(GetTileOwner(v->tile), new AIEventDisasterZeppelinerCleared(st->index));
@@ -274,9 +270,7 @@
 		v->age = 0;
 	}
 
-	if (IsValidTile(v->tile) &&
-			IsTileType(v->tile, MP_STATION) &&
-			IsAirport(v->tile)) {
+	if (IsValidTile(v->tile) && IsAirportTile(v->tile)) {
 		SETBITS(Station::GetByTile(v->tile)->airport_flags, RUNWAY_IN_block);
 	}
 
--- a/src/water_cmd.cpp
+++ b/src/water_cmd.cpp
@@ -724,7 +724,7 @@
 {
 	byte z = 0;
 
-	if (IsTileType(tile, MP_STATION) && IsAirport(tile)) {
+	if (IsAirportTile(tile)) {
 		const Station *st = Station::GetByTile(tile);
 		const AirportSpec *as = st->GetAirportSpec();
 		z = 1 + st->Airport()->delta_z;
@@ -773,7 +773,7 @@
 		/* Crashing aircraft are always at z_pos == 1, never on z_pos == 0,
 		 * because that's always the shadow. Except for the heliport, because
 		 * that station has a big z_offset for the aircraft. */
-		if (!IsTileType(v->tile, MP_STATION) || !IsAirport(v->tile) || GetTileMaxZ(v->tile) != 0) return;
+		if (!IsAirportTile(v->tile) || GetTileMaxZ(v->tile) != 0) return;
 		const Station *st = Station::GetByTile(v->tile);
 		const AirportFTAClass *airport = st->Airport();