diff --git a/water_cmd.c b/water_cmd.c --- a/water_cmd.c +++ b/water_cmd.c @@ -215,7 +215,7 @@ int32 CmdBuildCanal(int x, int y, uint32 int size_x, size_y; int sx, sy; - if (p1 > MapSize()) return CMD_ERROR; + if (p1 >= MapSize()) return CMD_ERROR; sx = TileX(p1); sy = TileY(p1);