summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2018-11-06 12:35:00 +0100
committerErich Eckner <git@eckner.net>2022-01-16 21:58:16 +0100
commit16fbc0a3bdbecfa95d444dfb3a39530e1d998f3f (patch)
tree3b7863a958728e21a562403925868d5e2b81bfcf
parent2057b9bc86ea48508b50aa1415a01e91afd1596b (diff)
downloadopenttd-16fbc0a3bdbecfa95d444dfb3a39530e1d998f3f.tar.xz
rectangle operations should be operating on the top layer
-rw-r--r--src/station.cpp10
1 files 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));