Skip to content

Commit

Permalink
Revert "Don't override key input state from Lua script"
Browse files Browse the repository at this point in the history
This reverts commit d8a53ce.

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.
  • Loading branch information
AntonioND committed Mar 31, 2021
1 parent 07c2b3a commit bab0acf
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions source/gui/win_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit bab0acf

Please sign in to comment.