src/station_cmd.cpp
changeset 6204 c237d8081b58
parent 6165 4da5ead702ad
child 6214 aab08beb5652
equal deleted inserted replaced
6203:146a5a13d91a 6204:c237d8081b58
  1804 		/* Buoys are marked in the Station struct by this flag. Yes, it is this
  1804 		/* Buoys are marked in the Station struct by this flag. Yes, it is this
  1805 		 * braindead.. */
  1805 		 * braindead.. */
  1806 		st->facilities &= ~FACIL_DOCK;
  1806 		st->facilities &= ~FACIL_DOCK;
  1807 		st->had_vehicle_of_type &= ~HVOT_BUOY;
  1807 		st->had_vehicle_of_type &= ~HVOT_BUOY;
  1808 
  1808 
  1809 		MakeWater(tile);
  1809 		/* We have to set the water tile's state to the same state as before the
       
  1810 		 * buoy was placed. Otherwise one could plant a buoy on a canal edge,
       
  1811 		 * remove it and flood the land (if the canal edge is at level 0) */
       
  1812 		Owner o = GetTileOwner(tile);
       
  1813 		if (o == OWNER_WATER) {
       
  1814 			MakeWater(tile);
       
  1815 		} else {
       
  1816 			MakeCanal(tile, o);
       
  1817 		}
  1810 		MarkTileDirtyByTile(tile);
  1818 		MarkTileDirtyByTile(tile);
  1811 
  1819 
  1812 		UpdateStationVirtCoordDirty(st);
  1820 		UpdateStationVirtCoordDirty(st);
  1813 		DeleteStationIfEmpty(st);
  1821 		DeleteStationIfEmpty(st);
  1814 	}
  1822 	}