summaryrefslogtreecommitdiff
path: root/src/water_cmd.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/water_cmd.cpp')
-rw-r--r--src/water_cmd.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/water_cmd.cpp b/src/water_cmd.cpp
index 119432abe..b9f2f348a 100644
--- a/src/water_cmd.cpp
+++ b/src/water_cmd.cpp
@@ -644,10 +644,9 @@ static void TileLoopWaterHelper(TileIndex tile, const TileIndexDiffC *offs)
MakeWater(target);
MarkTileDirtyByTile(target);
/* Mark surrounding canal tiles dirty too to avoid glitches */
- MarkTileDirtyIfCanal(target + TileDiffXY(0, 1));
- MarkTileDirtyIfCanal(target + TileDiffXY(1, 0));
- MarkTileDirtyIfCanal(target + TileDiffXY(0, -1));
- MarkTileDirtyIfCanal(target + TileDiffXY(-1, 0));
+ for (Direction dir = DIR_BEGIN; dir < DIR_END; dir++) {
+ MarkTileDirtyIfCanal(target + TileOffsByDir(dir));
+ }
}
}
}