summaryrefslogtreecommitdiff
path: root/src/station_cmd.cpp
diff options
context:
space:
mode:
authorKUDr <KUDr@openttd.org>2007-02-02 20:20:56 +0000
committerKUDr <KUDr@openttd.org>2007-02-02 20:20:56 +0000
commit5198acfe22fd24b1e69924bec7dde99a061538be (patch)
tree2a3b489331a02811f4e08ceba6fbda7c1c61c24a /src/station_cmd.cpp
parentdede09363926eb0e1206c33cf19a7204e6f0bb7c (diff)
downloadopenttd-5198acfe22fd24b1e69924bec7dde99a061538be.tar.xz
(svn r8540) -Fix[YAPF]: Assert when buoy is placed on NE or NW map edge (Dan)
Diffstat (limited to 'src/station_cmd.cpp')
-rw-r--r--src/station_cmd.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/station_cmd.cpp b/src/station_cmd.cpp
index 0a6ff2552..6e3e1b4d1 100644
--- a/src/station_cmd.cpp
+++ b/src/station_cmd.cpp
@@ -2134,7 +2134,14 @@ static uint32 GetTileTrackStatus_Station(TileIndex tile, TransportType mode)
case TRANSPORT_WATER:
// buoy is coded as a station, it is always on open water
- if (IsBuoy(tile)) return TRACK_BIT_ALL * 0x101;
+ if (IsBuoy(tile)) {
+ TrackBits ts = TRACK_BIT_ALL;
+ // remove tracks that connect NE map edge
+ if (TileX(tile) == 0) ts &= ~(TRACK_BIT_X | TRACK_BIT_UPPER | TRACK_BIT_RIGHT);
+ // remove tracks that connect NW map edge
+ if (TileY(tile) == 0) ts &= ~(TRACK_BIT_Y | TRACK_BIT_LEFT | TRACK_BIT_UPPER);
+ return uint32(ts) * 0x101;
+ }
break;
case TRANSPORT_ROAD: