From ab542720b7c7599d22f6a7a19f8cc98cabcf4131 Mon Sep 17 00:00:00 2001 From: fdai7753 Date: Sun, 4 Feb 2024 19:13:29 +0100 Subject: [PATCH] refactoring: Fixed wasd+ctrl glitch causing crashes --- src/main/java/pacmanGame/Program.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/main/java/pacmanGame/Program.java b/src/main/java/pacmanGame/Program.java index 734bfc4..d835fa4 100644 --- a/src/main/java/pacmanGame/Program.java +++ b/src/main/java/pacmanGame/Program.java @@ -42,9 +42,11 @@ public class Program { } public void ForwardInputToGameManager() { - for (char inputChar : input.inputList) { - gameManager.ProcessInput(inputChar); - } + try { + for (char inputChar : input.inputList) { + gameManager.ProcessInput(inputChar); + } + } catch (Exception e) {} input.inputList.clear(); }