From 1d04bc24137cf110c45231cc2fdebe928dd46886 Mon Sep 17 00:00:00 2001 From: Martti Soininen Date: Wed, 3 Jul 2024 11:00:55 +0300 Subject: [PATCH] Improve input handling --- src/components/Tetris.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/Tetris.tsx b/src/components/Tetris.tsx index f4fa4fc..3331119 100644 --- a/src/components/Tetris.tsx +++ b/src/components/Tetris.tsx @@ -502,8 +502,7 @@ export default function(props: TetrisProps) { }); function registerPlayerAction(action: PlayerAction) { - const current = activeAction(); - if (current !== action) { + if (!actionStack.includes(action)) { actionStack.push(action); newAction = true; repeating = false; @@ -642,7 +641,8 @@ function TetrisControlButton(props: TetrisButtonProps) { )