summaryrefslogtreecommitdiff
path: root/misc_gui.c
diff options
context:
space:
mode:
authorpeter1138 <peter1138@openttd.org>2006-01-23 19:12:35 +0000
committerpeter1138 <peter1138@openttd.org>2006-01-23 19:12:35 +0000
commit70efa805cb835fed82b2d8acb6277a556cea2bc9 (patch)
treec39194f0717a2c8b05575f3e9c42728e3a79ff04 /misc_gui.c
parent93082104dda8f0a550609f1f24ded10f407c755e (diff)
downloadopenttd-70efa805cb835fed82b2d8acb6277a556cea2bc9.tar.xz
(svn r3421) - Revert r3412 as it didn't work.
- Fix station builder issue by checking the tile is in bounds.
Diffstat (limited to 'misc_gui.c')
-rw-r--r--misc_gui.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/misc_gui.c b/misc_gui.c
index 8517782f8..8579a2dc7 100644
--- a/misc_gui.c
+++ b/misc_gui.c
@@ -704,11 +704,10 @@ static void DrawStationCoverageText(const AcceptedCargo accepts,
}
void DrawStationCoverageAreaText(int sx, int sy, uint mask, int rad) {
- int x = _thd.pos.x;
- int y = _thd.pos.y;
+ TileIndex tile = TileVirtXY(_thd.pos.x, _thd.pos.y);
AcceptedCargo accepts;
- if (x != -1) {
- GetAcceptanceAroundTiles(accepts, TileVirtXY(x, y), _thd.size.x / 16, _thd.size.y / 16 , rad);
+ if (tile < MapSize()) {
+ GetAcceptanceAroundTiles(accepts, tile, _thd.size.x / 16, _thd.size.y / 16 , rad);
DrawStationCoverageText(accepts, sx, sy, mask);
}
}