Changeset - r2870:a1f183dea204
[Not reviewed]
master
0 1 0
peter1138 - 18 years ago 2006-01-22 16:23:05
peter1138@openttd.org
(svn r3418) - Fix: When removing a town-owned tunnel the player's rating was not reduced, as it checked the ownership of the tunnel after clearing it. Now we perform the rating adjustment before clearing the tiles. (spotted by glx)
1 file changed with 5 insertions and 2 deletions:
0 comments (0 inline, 0 general)
tunnelbridge_cmd.c
Show inline comments
 
@@ -685,12 +685,15 @@ static int32 DoClearTunnel(TileIndex til
 
		//  else the direction is always 0.. dah!! ;)
 
		byte tile_dir = GB(_m[tile].m5, 0, 2);
 
		byte endtile_dir = GB(_m[endtile].m5, 0, 2);
 

	
 
		// Adjust the town's player rating. Do this before removing the tile owner info.
 
		if (IsTileOwner(tile, OWNER_TOWN) && _game_mode != GM_EDITOR)
 
			ChangeTownRating(t, RATING_TUNNEL_BRIDGE_DOWN_STEP, RATING_TUNNEL_BRIDGE_MINIMUM);
 

	
 
		DoClearSquare(tile);
 
		DoClearSquare(endtile);
 
		UpdateSignalsOnSegment(tile, _updsignals_tunnel_dir[tile_dir]);
 
		UpdateSignalsOnSegment(endtile, _updsignals_tunnel_dir[endtile_dir]);
 
		if (IsTileOwner(tile, OWNER_TOWN) && _game_mode != GM_EDITOR)
 
			ChangeTownRating(t, RATING_TUNNEL_BRIDGE_DOWN_STEP, RATING_TUNNEL_BRIDGE_MINIMUM);
 
	}
 
	return _price.clear_tunnel * (length + 1);
 
}
0 comments (0 inline, 0 general)