mirror of https://github.com/OpenTTD/OpenTTD
(svn r14469) -Fix [FS#2355]: Empty station spreads (e.g. from greyed station signs) were modified in test mode.
parent
b3742c0165
commit
7f5f0fea42
|
@ -286,9 +286,10 @@ bool StationRect::BeforeAddTile(TileIndex tile, StationRectMode mode)
|
||||||
int y = TileY(tile);
|
int y = TileY(tile);
|
||||||
if (IsEmpty()) {
|
if (IsEmpty()) {
|
||||||
/* we are adding the first station tile */
|
/* we are adding the first station tile */
|
||||||
left = right = x;
|
if (mode != ADD_TEST) {
|
||||||
top = bottom = y;
|
left = right = x;
|
||||||
|
top = bottom = y;
|
||||||
|
}
|
||||||
} else if (!PtInExtendedRect(x, y)) {
|
} else if (!PtInExtendedRect(x, y)) {
|
||||||
/* current rect is not empty and new point is outside this rect */
|
/* current rect is not empty and new point is outside this rect */
|
||||||
/* make new spread-out rectangle */
|
/* make new spread-out rectangle */
|
||||||
|
@ -316,7 +317,8 @@ bool StationRect::BeforeAddTile(TileIndex tile, StationRectMode mode)
|
||||||
|
|
||||||
bool StationRect::BeforeAddRect(TileIndex tile, int w, int h, StationRectMode mode)
|
bool StationRect::BeforeAddRect(TileIndex tile, int w, int h, StationRectMode mode)
|
||||||
{
|
{
|
||||||
return BeforeAddTile(tile, mode) && BeforeAddTile(TILE_ADDXY(tile, w - 1, h - 1), mode);
|
return (mode == ADD_FORCE || (w <= _settings_game.station.station_spread && h <= _settings_game.station.station_spread)) && // important when the old rect is completely inside the new rect, resp. the old one was empty
|
||||||
|
BeforeAddTile(tile, mode) && BeforeAddTile(TILE_ADDXY(tile, w - 1, h - 1), mode);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*static*/ bool StationRect::ScanForStationTiles(StationID st_id, int left_a, int top_a, int right_a, int bottom_a)
|
/*static*/ bool StationRect::ScanForStationTiles(StationID st_id, int left_a, int top_a, int right_a, int bottom_a)
|
||||||
|
|
Loading…
Reference in New Issue