Fix right wall collisions

cpp
Elnu 3 years ago
parent 4d3e1d3b2d
commit cda6883dd6

@ -197,7 +197,7 @@ int main()
bool obstructed = false; bool obstructed = false;
if (movement != 0) { if (movement != 0) {
for (auto tile : block.get_tiles()) { 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; obstructed = true;
goto after_movement_loop; goto after_movement_loop;
} }

Loading…
Cancel
Save