From 16fbc0a3bdbecfa95d444dfb3a39530e1d998f3f 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 5f60c7a2a..14ac504a8 100644 --- a/src/station.cpp +++ b/src/station.cpp @@ -571,7 +571,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(); @@ -594,10 +594,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