From b2e3088d08c03d3950e648623185d73b715399d8 Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Tue, 6 Nov 2018 12:35:00 +0100 Subject: rectangle operations should be operating on the top layer --- src/station.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/station.cpp b/src/station.cpp index 7e4ce215d..1266de7f2 100644 --- a/src/station.cpp +++ b/src/station.cpp @@ -476,7 +476,7 @@ CommandCost StationRect::BeforeAddRect(TileIndex tile, int w, int h, StationRect { /* Станция может находится на любом уровне. * Значит надо обойти все слои */ - TileArea ta(TileXY(left_a, top_a), TileXY(right_a, bottom_a)); + TileArea ta(TopTile(TileXY(left_a, top_a)), TopTile(TileXY(right_a, bottom_a))); FOR_ALL_LAYERS(layer) { ta.tile = TopTile(ta.tile) + layer * LayerSize(); @@ -499,10 +499,10 @@ bool StationRect::AfterRemoveTile(BaseStation *st, TileIndex tile) * do it until we have empty rect or nothing to do */ for (;;) { /* check if removed tile is on rect edge */ - bool left_edge = (x == this->left); - bool right_edge = (x == this->right); - bool top_edge = (y == this->top); - bool bottom_edge = (y == this->bottom); + bool left_edge = (x == TopTile(this->left)); + bool right_edge = (x == TopTile(this->right)); + bool top_edge = (y == TopTile(this->top)); + bool bottom_edge = (y == TopTile(this->bottom)); /* can we reduce the rect in either direction? */ bool reduce_x = ((left_edge || right_edge) && !ScanForStationTiles(st->index, x, this->top, x, this->bottom)); -- cgit v1.2.3-70-g09d2