summaryrefslogtreecommitdiff
path: root/src/station_cmd.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2007-11-24 08:45:04 +0000
committerrubidium <rubidium@openttd.org>2007-11-24 08:45:04 +0000
commitea072322fa099509b5e8aeb1d9c8be9f857dd972 (patch)
treecf761cfea846d41d39350cafe88182e83c852d93 /src/station_cmd.cpp
parentc8add525041eaf50020a12ce13fd63d86b6d26b8 (diff)
downloadopenttd-ea072322fa099509b5e8aeb1d9c8be9f857dd972.tar.xz
(svn r11504) -Fix [FS#1467]: removing docks/ship depots could result in non-canal water where canals should have been build.
Diffstat (limited to 'src/station_cmd.cpp')
-rw-r--r--src/station_cmd.cpp13
1 files changed, 3 insertions, 10 deletions
diff --git a/src/station_cmd.cpp b/src/station_cmd.cpp
index 6f3eb7e11..c969ef459 100644
--- a/src/station_cmd.cpp
+++ b/src/station_cmd.cpp
@@ -44,6 +44,7 @@
#include "strings.h"
#include "autoslope.h"
#include "transparency.h"
+#include "water.h"
DEFINE_OLD_POOL_GENERIC(Station, Station)
DEFINE_OLD_POOL_GENERIC(RoadStop, RoadStop)
@@ -1899,12 +1900,7 @@ static CommandCost RemoveBuoy(Station *st, uint32 flags)
/* We have to set the water tile's state to the same state as before the
* buoy was placed. Otherwise one could plant a buoy on a canal edge,
* remove it and flood the land (if the canal edge is at level 0) */
- Owner o = GetTileOwner(tile);
- if (o == OWNER_WATER) {
- MakeWater(tile);
- } else {
- MakeCanal(tile, o);
- }
+ MakeWaterOrCanalDependingOnSurroundings(tile, GetTileOwner(tile));
MarkTileDirtyByTile(tile);
UpdateStationVirtCoordDirty(st);
@@ -2040,7 +2036,7 @@ static CommandCost RemoveDock(Station *st, uint32 flags)
if (flags & DC_EXEC) {
DoClearSquare(tile1);
- MakeWater(tile2);
+ MakeWaterOrCanalDependingOnSurroundings(tile2, st->owner);
st->rect.AfterRemoveTile(st, tile1);
st->rect.AfterRemoveTile(st, tile2);
@@ -2064,9 +2060,6 @@ const DrawTileSprites *GetStationTileLayout(StationType st, byte gfx)
return &_station_display_datas[st][gfx];
}
-/* For drawing canal edges on buoys */
-extern void DrawCanalWater(TileIndex tile);
-
static void DrawTile_Station(TileInfo *ti)
{
const DrawTileSprites *t = NULL;