road_cmd.c
changeset 5009 0ae33f104d4f
parent 4850 93095755db8c
child 5116 3c0c3da214ca
equal deleted inserted replaced
5008:c2b96042d529 5009:0ae33f104d4f
   108 	if (!IsTileType(tile, MP_STREET) && !IsTileType(tile, MP_TUNNELBRIDGE)) return CMD_ERROR;
   108 	if (!IsTileType(tile, MP_STREET) && !IsTileType(tile, MP_TUNNELBRIDGE)) return CMD_ERROR;
   109 
   109 
   110 	owner = IsLevelCrossingTile(tile) ? GetCrossingRoadOwner(tile) : GetTileOwner(tile);
   110 	owner = IsLevelCrossingTile(tile) ? GetCrossingRoadOwner(tile) : GetTileOwner(tile);
   111 
   111 
   112 	if (owner == OWNER_TOWN && _game_mode != GM_EDITOR) {
   112 	if (owner == OWNER_TOWN && _game_mode != GM_EDITOR) {
   113 		if (IsTileType(tile, MP_TUNNELBRIDGE)) { // index of town is not saved for bridge (no space)
   113 		/* Are we removing a piece of road below a bridge, or not. If below
       
   114 		 * a bridge we need to calculate the town's index as it is not saved
       
   115 		 * in the map array (no space) */
       
   116 		if (IsTileType(tile, MP_TUNNELBRIDGE)) {
   114 			t = ClosestTownFromTile(tile, _patches.dist_local_authority);
   117 			t = ClosestTownFromTile(tile, _patches.dist_local_authority);
   115 		} else {
   118 		} else {
   116 			t = GetTownByTile(tile);
   119 			t = GetTownByTile(tile);
   117 		}
   120 		}
   118 	} else {
   121 	} else {