(svn r44) Fix: Coast line near edge of map and near oilrigs (Dribbel)
authordominik
Fri, 13 Aug 2004 19:52:45 +0000
changeset 43 3b93861c5478
parent 42 567add3568d6
child 44 1923acc255d1
(svn r44) Fix: Coast line near edge of map and near oilrigs (Dribbel)
industry_cmd.c
station_cmd.c
water_cmd.c
--- a/industry_cmd.c	Fri Aug 13 19:18:53 2004 +0000
+++ b/industry_cmd.c	Fri Aug 13 19:52:45 2004 +0000
@@ -725,6 +725,14 @@
 #define SET_AND_UNANIMATE(tile,a,b) { _map5[tile]=a; _map_owner[tile]=b; DeleteAnimatedTile(tile); }
 
 	switch(_map5[tile]) {
+	case 0x18: // coast line at oilrigs
+	case 0x19:
+	case 0x1A:
+	case 0x1B:
+	case 0x1C:
+		TileLoop_Water(tile);
+		break;
+
 	case 0:
 		if (!(_tick_counter & 0x400) && CHANCE16(1,2))
 			SET_AND_ANIMATE(tile,1,0x80);
--- a/station_cmd.c	Fri Aug 13 19:18:53 2004 +0000
+++ b/station_cmd.c	Fri Aug 13 19:52:45 2004 +0000
@@ -1841,6 +1841,11 @@
 	// treat a bouy tile as water.
 	else if (_map5[tile] == 0x52)
 		TileLoop_Water(tile);
+
+	// treat a oilrig (the station part) as water
+	else if (_map5[tile] == 0x4B)
+		TileLoop_Water(tile);
+
 }
 
 
--- a/water_cmd.c	Fri Aug 13 19:18:53 2004 +0000
+++ b/water_cmd.c	Fri Aug 13 19:52:45 2004 +0000
@@ -528,6 +528,20 @@
 		for(i=0; i!=4; i++)
 			TileLoopWaterHelper(tile, _tile_loop_offs_array[i]);
 	}
+
+	// edges
+	if ( GET_TILE_X(tile)==0 && IS_INT_INSIDE(GET_TILE_Y(tile),1,TILES_Y-3+1)) //NE
+		TileLoopWaterHelper(tile, _tile_loop_offs_array[2]);
+
+	if ( GET_TILE_X(tile)==(TILES_X-2) && IS_INT_INSIDE(GET_TILE_Y(tile),1,TILES_Y-3+1)) //SW
+		TileLoopWaterHelper(tile, _tile_loop_offs_array[0]);
+
+	if ( GET_TILE_Y(tile)==0 && IS_INT_INSIDE(GET_TILE_X(tile),1,TILES_X-3+1)) //NW
+		TileLoopWaterHelper(tile, _tile_loop_offs_array[1]);
+
+	if ( GET_TILE_Y(tile)==(TILES_Y-2) && IS_INT_INSIDE(GET_TILE_X(tile),1,TILES_X-3+1)) //SE
+		TileLoopWaterHelper(tile, _tile_loop_offs_array[3]);
+
 }