From bab0acf9119efca15886787f9edbc9fd56afb9a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antonio=20Ni=C3=B1o=20D=C3=ADaz?= Date: Wed, 31 Mar 2021 01:07:03 +0100 Subject: [PATCH] Revert "Don't override key input state from Lua script" This reverts commit d8a53ce711074147e9fd0664e2830c5d458bf731. There is no safe way to remove this. The problem appears when the first line of the script (or around the first line) there is a line that sets the key input state. This line may be executed before or after the input is initialized in the main loop, and it isn't trivial to fix it. Instead of fixing it, it's better to ask the scripts to wait for at least one frame before setting the key input state. --- source/gui/win_main.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/source/gui/win_main.c b/source/gui/win_main.c index cbb08af..e7d3985 100644 --- a/source/gui/win_main.c +++ b/source/gui/win_main.c @@ -1404,12 +1404,9 @@ int Win_MainCreate(char *rom_path) } } - if (!Script_IsRunning()) - { - // Initialize state - Input_Update_GB(); - Input_Update_GBA(); - } + // Initialize state + Input_Update_GB(); + Input_Update_GBA(); return 0; }