Changeset - r11312:92ed0077d87f
[Not reviewed]
master
0 1 0
yexo - 15 years ago 2009-03-10 23:16:45
yexo@openttd.org
(svn r15667) -Fix (r15601)[FS#2718]: It was possible to remove rail tunnels/bridges and aqueducts build by rival companies.
1 file changed with 10 insertions and 0 deletions:
0 comments (0 inline, 0 general)
src/tunnelbridge_cmd.cpp
Show inline comments
 
@@ -584,6 +584,8 @@ static inline bool CheckAllowRemoveTunne
 
	/* Floods can remove anything as well as the scenario editor */
 
	if (_current_company == OWNER_WATER || _game_mode == GM_EDITOR) return true;
 

	
 
	switch (GetTunnelBridgeTransportType(tile)) {
 
		case TRANSPORT_ROAD: {
 
	RoadTypes rts = GetRoadTypes(tile);
 
	Owner road_owner = _current_company;
 
	Owner tram_owner = _current_company;
 
@@ -598,6 +600,14 @@ static inline bool CheckAllowRemoveTunne
 
	return CheckOwnership(road_owner) && CheckOwnership(tram_owner);
 
}
 

	
 
		case TRANSPORT_RAIL:
 
		case TRANSPORT_WATER:
 
			return CheckOwnership(GetTileOwner(tile));
 

	
 
		default: NOT_REACHED();
 
	}
 
}
 

	
 
static CommandCost DoClearTunnel(TileIndex tile, DoCommandFlag flags)
 
{
 
	Town *t = NULL;
0 comments (0 inline, 0 general)