mirror of https://github.com/OpenTTD/OpenTTD.git
(svn r3421) - Revert r3412 as it didn't work.
- Fix station builder issue by checking the tile is in bounds.
This commit is contained in:
parent
93082104dd
commit
70efa805cb
|
@ -704,11 +704,10 @@ static void DrawStationCoverageText(const AcceptedCargo accepts,
|
||||||
}
|
}
|
||||||
|
|
||||||
void DrawStationCoverageAreaText(int sx, int sy, uint mask, int rad) {
|
void DrawStationCoverageAreaText(int sx, int sy, uint mask, int rad) {
|
||||||
int x = _thd.pos.x;
|
TileIndex tile = TileVirtXY(_thd.pos.x, _thd.pos.y);
|
||||||
int y = _thd.pos.y;
|
|
||||||
AcceptedCargo accepts;
|
AcceptedCargo accepts;
|
||||||
if (x != -1) {
|
if (tile < MapSize()) {
|
||||||
GetAcceptanceAroundTiles(accepts, TileVirtXY(x, y), _thd.size.x / 16, _thd.size.y / 16 , rad);
|
GetAcceptanceAroundTiles(accepts, tile, _thd.size.x / 16, _thd.size.y / 16 , rad);
|
||||||
DrawStationCoverageText(accepts, sx, sy, mask);
|
DrawStationCoverageText(accepts, sx, sy, mask);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -814,10 +814,6 @@ void SwitchMode(int new_mode)
|
||||||
|
|
||||||
if (_switch_mode_errorstr != INVALID_STRING_ID)
|
if (_switch_mode_errorstr != INVALID_STRING_ID)
|
||||||
ShowErrorMessage(INVALID_STRING_ID,_switch_mode_errorstr,0,0);
|
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));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue