diff options
author | Ekaitz Zarraga <ekaitz@elenq.tech> | 2022-05-21 22:22:09 +0200 |
---|---|---|
committer | Ekaitz Zarraga <ekaitz@elenq.tech> | 2022-05-21 22:22:09 +0200 |
commit | 27a55a2e841e9c248d6b055780a519a7b5ee4263 (patch) | |
tree | 275119c5a3b6d96147b30999410e42aa1d68f740 /src/game.cpp | |
parent | 41d2578d3401e38fa8600a533ad5998dc39e7be5 (diff) |
Check grid bounds on cellIsEmpty
Diffstat (limited to 'src/game.cpp')
-rw-r--r-- | src/game.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/game.cpp b/src/game.cpp index 17000a0..47526c8 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -101,7 +101,7 @@ void GameState::render(){ } bool GameState::cellIsEmpty(Point* p){ - return( grid[p->y][p->x] == 0 ); + return( p->x < GRID_WIDTH && p->x >= 0 && grid[p->y][p->x] == 0 ); } void GameState::pressRotate(){} |