aboutsummaryrefslogtreecommitdiff
path: root/Tile.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Tile.cpp')
-rw-r--r--Tile.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/Tile.cpp b/Tile.cpp
index 7c235f5..6efb14d 100644
--- a/Tile.cpp
+++ b/Tile.cpp
@@ -35,9 +35,9 @@ Tile * Tile::get_neighbor(int dx, int dy) {
int x = this->x + dx;
int y = this->y + dy;
if (x < 0) return nullptr;
- if (x > canvas.data.columns) return nullptr;
+ if (x >= canvas.data.columns) return nullptr;
if (y < 0) return nullptr;
- if (y > canvas.data.columns) return nullptr;
+ if (y >= canvas.data.columns) return nullptr;
return &canvas.get_tile(x, y);
}