misc_gui.c
changeset 2873 75b688d160d5
parent 2753 15012faaa68a
child 2887 d5967e472eee
--- a/misc_gui.c	Mon Jan 23 17:43:46 2006 +0000
+++ b/misc_gui.c	Mon Jan 23 19:12:35 2006 +0000
@@ -704,11 +704,10 @@
 }
 
 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);
 	}
 }