summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheo Buehler <tb@cvs.openbsd.org>2016-06-10 13:07:08 +0000
committerTheo Buehler <tb@cvs.openbsd.org>2016-06-10 13:07:08 +0000
commit49deb299f178d3b0954df7fa6e955ad211dc73ba (patch)
treef105355dbe85e3b169a0ec774720a927534a4f58
parentf3e040eca3e9dad1b4f3fed5164138f5a230dcd9 (diff)
When eliding a row, clear the invisible row zero, so that no columns
can become unusable during game play. Same fix was made in NetBSD's tetris.c -r1.31 by Christos Zoulas almost exactly a year ago. ok tedu
-rw-r--r--games/tetris/tetris.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/games/tetris/tetris.c b/games/tetris/tetris.c
index 73ceaae708b..62d69c128df 100644
--- a/games/tetris/tetris.c
+++ b/games/tetris/tetris.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tetris.c,v 1.30 2016/03/07 12:07:57 mestre Exp $ */
+/* $OpenBSD: tetris.c,v 1.31 2016/06/10 13:07:07 tb Exp $ */
/* $NetBSD: tetris.c,v 1.2 1995/04/22 07:42:47 cgd Exp $ */
/*-
@@ -105,6 +105,7 @@ elide(void)
tsleep();
while (--base != 0)
board[base + B_COLS] = board[base];
+ memset(&board[1], 0, B_COLS - 2);
scr_update();
tsleep();
break;