From 3dc8dcf3123c056f6ebd8fafa0640ef1866ea53e Mon Sep 17 00:00:00 2001 From: truelight Date: Sat, 25 Sep 2004 17:37:32 +0000 Subject: (svn r320) -Fix: some last _current_player fixes --- industry_cmd.c | 3 +++ town_cmd.c | 2 ++ water_cmd.c | 3 +++ 3 files changed, 8 insertions(+) diff --git a/industry_cmd.c b/industry_cmd.c index 414a24e27..6fe5e0c73 100644 --- a/industry_cmd.c +++ b/industry_cmd.c @@ -999,6 +999,7 @@ static void ChopLumberMillTrees(Industry *i) 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 @@ static void ChopLumberMillTrees(Industry *i) SetMapExtraBits(tile, 0); i->cargo_waiting[0] = min(0xffff, i->cargo_waiting[0] + 45); + + _current_player = old_player; return; } tile += _chop_dir[dir]; diff --git a/town_cmd.c b/town_cmd.c index 54237df99..640ce048b 100644 --- a/town_cmd.c +++ b/town_cmd.c @@ -250,6 +250,8 @@ static void TileLoop_Town(uint tile) if ( (byte) (r >> 8) >= 12) { DoBuildTownHouse(t, tile); } + + _current_player = OWNER_NONE; } } diff --git a/water_cmd.c b/water_cmd.c index 8aad805ae..1ac3cba18 100644 --- a/water_cmd.c +++ b/water_cmd.c @@ -583,6 +583,9 @@ void TileLoop_Water(uint tile) 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 -- cgit v1.2.3-54-g00ecf