From 79f1c2b97b50dc04d2770b3eac485e7ab0d00830 Mon Sep 17 00:00:00 2001 From: Jonathan G Rennison Date: Wed, 26 Sep 2018 01:32:32 +0100 Subject: [PATCH] Zoning: Fix off-by-one in zoning cache rect invalidation (SW edge) --- src/zoning_cmd.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/zoning_cmd.cpp b/src/zoning_cmd.cpp index e94022ce1a..8f42159e21 100644 --- a/src/zoning_cmd.cpp +++ b/src/zoning_cmd.cpp @@ -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); }