summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2018-11-06 12:35:00 +0100
committerErich Eckner <git@eckner.net>2018-11-16 19:11:47 +0100
commitb2e3088d08c03d3950e648623185d73b715399d8 (patch)
tree105d256262cd4affb166849f950c107d8175d741
parent475fa465d7d793416520d1723012eafe73c721a8 (diff)
downloadopenttd-b2e3088d08c03d3950e648623185d73b715399d8.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 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));