Zoning: Fix off-by-one in zoning cache rect invalidation (SW edge)

This commit is contained in:
Jonathan G Rennison
2018-09-26 01:32:32 +01:00
parent cff61bac96
commit 79f1c2b97b

View File

@@ -459,7 +459,7 @@ void ZoningMarkDirtyStationCoverageArea(const Station *st, ZoningModeMask mask)
for (int y = rect.top; y <= rect.bottom; y++) {
auto iter = cache.lower_bound(TileXY(rect.left, y) << 3);
auto end_iter = iter;
uint end = TileXY(rect.right, y) << 3;
uint end = (TileXY(rect.right, y) + 1) << 3;
while (end_iter != cache.end() && *end_iter < end) ++end_iter;
cache.erase(iter, end_iter);
}