disaster_cmd.c
changeset 926 bd4312619522
parent 919 b0d6c7642f99
child 1035 0a170deb6e33
--- a/disaster_cmd.c	Fri Jan 07 12:33:28 2005 +0000
+++ b/disaster_cmd.c	Fri Jan 07 17:02:43 2005 +0000
@@ -253,8 +253,8 @@
 
 	if (v->current_order.station == 0) {
 // fly around randomly
-		int x = GET_TILE_X(v->dest_tile)*16;
-		int y = GET_TILE_Y(v->dest_tile)*16;
+		int x = TileX(v->dest_tile) * 16;
+		int y = TileY(v->dest_tile) * 16;
 		if (abs(x - v->x_pos) +	abs(y - v->y_pos) >= 16) {
 			v->direction = GetDirectionTowards(v, x, y);
 			GetNewVehiclePos(v, &gp);
@@ -352,8 +352,8 @@
 	if (v->current_order.station == 2) {
 		if (!(v->tick_counter&3)) {
 			Industry *i = GetIndustry(v->dest_tile);
-			int x = GET_TILE_X(i->xy)*16;
-			int y = GET_TILE_Y(i->xy)*16;
+			int x = TileX(i->xy) * 16;
+			int y = TileY(i->xy) * 16;
 			uint32 r = Random();
 
 			CreateEffectVehicleAbove(
@@ -423,8 +423,8 @@
 	if (v->current_order.station == 2) {
 		if (!(v->tick_counter&3)) {
 			Industry *i = GetIndustry(v->dest_tile);
-			int x = GET_TILE_X(i->xy)*16;
-			int y = GET_TILE_Y(i->xy)*16;
+			int x = TileX(i->xy) * 16;
+			int y = TileY(i->xy) * 16;
 			uint32 r = Random();
 
 			CreateEffectVehicleAbove(
@@ -501,8 +501,8 @@
 	v->tick_counter++;
 
 	if (v->current_order.station == 1) {
-		int x = GET_TILE_X(v->dest_tile)*16 + 8;
-		int y = GET_TILE_Y(v->dest_tile)*16 + 8;
+		int x = TileX(v->dest_tile) * 16 + 8;
+		int y = TileY(v->dest_tile) * 16 + 8;
 		if (abs(v->x_pos - x) + abs(v->y_pos - y) >= 8) {
 			v->direction = GetDirectionTowards(v, x, y);
 
@@ -553,8 +553,8 @@
 		w->vehstatus |= VS_DISASTER;
 	} else if (v->current_order.station < 1) {
 
-		int x = GET_TILE_X(v->dest_tile)*16;
-		int y = GET_TILE_Y(v->dest_tile)*16;
+		int x = TileX(v->dest_tile) * 16;
+		int y = TileY(v->dest_tile) * 16;
 		if (abs(x - v->x_pos) +	abs(y - v->y_pos) >= 16) {
 			v->direction = GetDirectionTowards(v, x, y);
 			GetNewVehiclePos(v, &gp);
@@ -702,13 +702,13 @@
 
 	/* Pick a random place, unless we find
 	    a small airport */
-	x = (GET_TILE_X(Random())) * 16 + 8;
+	x = TileX(Random()) * 16 + 8;
 
 	FOR_ALL_STATIONS(st) {
 		if (st->xy && st->airport_tile != 0 &&
 				st->airport_type <= 1 &&
 				IS_HUMAN_PLAYER(st->owner)) {
-			x = (GET_TILE_X(st->xy) + 2) * 16;
+			x = (TileX(st->xy) + 2) * 16;
 			break;
 		}
 	}
@@ -732,7 +732,7 @@
 	if (v == NULL)
 		return;
 
-	x = (GET_TILE_X(Random())) * 16 + 8;
+	x = TileX(Random()) * 16 + 8;
 
 	InitializeDisasterVehicle(v, x, 0, 135, 3, 2);
 	v->dest_tile = TILE_XY(MapSizeX() / 2, MapSizeY() / 2);
@@ -771,7 +771,7 @@
 		return;
 
 	x = (MapSizeX() + 9) * 16 - 1;
-	y = GET_TILE_Y(found->xy)*16 + 37;
+	y = TileY(found->xy) * 16 + 37;
 
 	InitializeDisasterVehicle(v,x,y, 135,1,4);
 
@@ -807,7 +807,7 @@
 		return;
 
 	x = -16 * 16;
-	y = GET_TILE_Y(found->xy)*16 + 37;
+	y = TileY(found->xy) * 16 + 37;
 
 	InitializeDisasterVehicle(v,x,y, 135,5,6);
 
@@ -833,7 +833,7 @@
 	if (v == NULL)
 		return;
 
-	x = (GET_TILE_X(Random())) * 16 + 8;
+	x = TileX(Random()) * 16 + 8;
 
 	y = MapMaxX() * 16 - 1;
 	InitializeDisasterVehicle(v, x, y, 135, 7, 9);
@@ -861,7 +861,7 @@
 		return;
 
 	r = Random();
-	x = (GET_TILE_X(r)) * 16 + 8;
+	x = TileX(r) * 16 + 8;
 
 	y = 8;
 	dir = 3;
@@ -882,7 +882,7 @@
 		return;
 
 	r = Random();
-	x = (GET_TILE_X(r)) * 16 + 8;
+	x = TileX(r) * 16 + 8;
 
 	y = 8;
 	dir = 3;