From cda6883dd6a724d221b1d36859b7bde73970867f Mon Sep 17 00:00:00 2001 From: ElnuDev Date: Sat, 5 Mar 2022 12:38:16 -0800 Subject: [PATCH] Fix right wall collisions --- src/Main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Main.cpp b/src/Main.cpp index d207c72..52389c8 100644 --- a/src/Main.cpp +++ b/src/Main.cpp @@ -197,7 +197,7 @@ int main() bool obstructed = false; if (movement != 0) { for (auto tile : block.get_tiles()) { - if (tile.x <= 0 || tile.x > GRID_WIDTH || grid[tile.y][tile.x + movement]) { + if (tile.x <= 0 || tile.x >= GRID_WIDTH - 1 || grid[tile.y][tile.x + movement]) { obstructed = true; goto after_movement_loop; }