(svn r3421) - Revert r3412 as it didn't work.
authorpeter1138
Mon, 23 Jan 2006 19:12:35 +0000
changeset 2873 75b688d160d5
parent 2872 ae5d9dbf8402
child 2874 30c79e6e1c3e
(svn r3421) - Revert r3412 as it didn't work.
- Fix station builder issue by checking the tile is in bounds.
misc_gui.c
openttd.c
--- 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);
 	}
 }
--- a/openttd.c	Mon Jan 23 17:43:46 2006 +0000
+++ b/openttd.c	Mon Jan 23 19:12:35 2006 +0000
@@ -814,10 +814,6 @@
 
 	if (_switch_mode_errorstr != INVALID_STRING_ID)
 		ShowErrorMessage(INVALID_STRING_ID,_switch_mode_errorstr,0,0);
-
-	// Reset the TileHighlightData as it may be out of bounds if
-	// the new map is smaller than the old map.
-	memset(&_thd, 0, sizeof(_thd));
 }