~sircmpwn/tetrominoes

ee5c067419ca7549b64f74af51deb189e20837b5 — Drew DeVault 2 years ago 4e8c92b
canmove: fix collision bug above y=0
1 files changed, 3 insertions(+), 3 deletions(-)

M update.ha
M update.ha => update.ha +3 -3
@@ 201,12 201,12 @@ fn canmove(
		if (active[active_ix] == 0) {
			continue;
		};
		if (x + active_x < 0 || x + active_x >= BOARD_WIDTH) {
			return false;
		};
		if (y + active_y < 0) {
			continue;
		};
		if (x + active_x >= BOARD_WIDTH) {
			return false;
		};
		const x = x + dx, y = y + dy;
		const board_ix = (y + active_y) * BOARD_WIDTH + (x + active_x);
		if (board_ix: size >= len(board) || board[board_ix] != 0) {