Fix recalculation area in UpdateTownCargoesHouse

This commit is contained in:
Jonathan G Rennison
2019-05-26 21:11:26 +01:00
parent 09edd07003
commit 6d9f9ec352
2 changed files with 3 additions and 3 deletions

View File

@@ -991,8 +991,8 @@ static void UpdateTownCargoesSingleGridArea(Town *t, TileIndex start, bool updat
static void UpdateTownCargoesHouse(Town *t, TileIndex start, bool x_two_tiles, bool y_two_tiles, bool update_total = true)
{
TileIndex lower = TileAddWrap(start, -1, -1);
TileIndex upper = TileAddWrap(start, x_two_tiles ? 2 : 1, y_two_tiles ? 2 : 1);
TileIndex lower = TileAddSaturating(start, -AcceptanceMatrix::GRID, -AcceptanceMatrix::GRID);
TileIndex upper = TileAddSaturating(start, AcceptanceMatrix::GRID + (x_two_tiles ? 1 : 0), AcceptanceMatrix::GRID + (y_two_tiles ? 1 : 0));
for (uint x = TileX(lower) & ~(AcceptanceMatrix::GRID - 1); x <= TileX(upper); x += AcceptanceMatrix::GRID) {
for (uint y = TileY(lower) & ~(AcceptanceMatrix::GRID - 1); y <= TileY(upper); y += AcceptanceMatrix::GRID) {
UpdateTownCargoesSingleGridArea(t, TileXY(x, y), false);