Mercurial > hg > openttd
changeset 2873:d79f2ecea760 draft
(svn r3421) - Revert r3412 as it didn't work.
- Fix station builder issue by checking the tile is in bounds.
author | peter1138 <peter1138@openttd.org> |
---|---|
date | Mon, 23 Jan 2006 19:12:35 +0000 |
parents | 83692a2b2bd2 |
children | d678cb87176c |
files | misc_gui.c openttd.c |
diffstat | 2 files changed, 3 insertions(+), 8 deletions(-) [+] |
line wrap: on
line diff
--- a/misc_gui.c +++ b/misc_gui.c @@ -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 +++ b/openttd.c @@ -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)); }