(svn r320) -Fix: some last _current_player fixes
authortruelight
Sat, 25 Sep 2004 17:37:32 +0000
changeset 314 75fe42199623
parent 313 0c7cac001d1a
child 315 6937bce0a9cb
(svn r320) -Fix: some last _current_player fixes
industry_cmd.c
town_cmd.c
water_cmd.c
--- a/industry_cmd.c	Sat Sep 25 13:58:27 2004 +0000
+++ b/industry_cmd.c	Sat Sep 25 17:37:32 2004 +0000
@@ -999,6 +999,7 @@
 			do {
 				tile = TILE_MASK(tile);
 				if (IS_TILETYPE(tile, MP_TREES)) {
+					uint old_player = _current_player;
 					/* found a tree */
 
 					_current_player = OWNER_NONE;
@@ -1010,6 +1011,8 @@
 					SetMapExtraBits(tile, 0);
 
 					i->cargo_waiting[0] = min(0xffff, i->cargo_waiting[0] + 45);
+
+					_current_player = old_player;
 					return;
 				}
 				tile += _chop_dir[dir];
--- a/town_cmd.c	Sat Sep 25 13:58:27 2004 +0000
+++ b/town_cmd.c	Sat Sep 25 17:37:32 2004 +0000
@@ -250,6 +250,8 @@
 		if ( (byte) (r >> 8) >= 12) {
 			DoBuildTownHouse(t, tile);
 		}
+
+		_current_player = OWNER_NONE;
 	}
 }
 
--- a/water_cmd.c	Sat Sep 25 13:58:27 2004 +0000
+++ b/water_cmd.c	Sat Sep 25 17:37:32 2004 +0000
@@ -583,6 +583,9 @@
 		for(i=0; i!=4; i++)
 			TileLoopWaterHelper(tile, _tile_loop_offs_array[i]);
 	}
+	// _current_player can be changed by TileLoopWaterHelper.. reset it back
+	//   here
+	_current_player = OWNER_NONE;
 
 	// edges
 	if ( GET_TILE_X(tile)==0 && IS_INT_INSIDE(GET_TILE_Y(tile),1,TILES_Y-3+1)) //NE