diff options
Diffstat (limited to 'Tile.cpp')
-rw-r--r-- | Tile.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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); } |