mirror of
https://github.com/coop-deluxe/sm64coopdx.git
synced 2025-12-05 15:43:02 +00:00
Fix crash on input box (#1043)
When typing ` into the coopnet password inputbox (the same as the console bind) It would do all of the null checks, then open the console changing the focus, then call a null function because the null checks are no longer valid. So I moved the null checks to where they're needed. Co-authored-by: MysterD <myster@d>
This commit is contained in:
parent
4ce9be4935
commit
a1b178fb64
1 changed files with 4 additions and 4 deletions
|
|
@ -279,10 +279,6 @@ bool djui_interactable_on_key_down(int scancode) {
|
|||
|
||||
void djui_interactable_on_key_up(int scancode) {
|
||||
|
||||
bool keyFocused = (gInteractableFocus != NULL)
|
||||
&& (gInteractableFocus->interactable != NULL)
|
||||
&& (gInteractableFocus->interactable->on_key_up != NULL);
|
||||
|
||||
if (!gDjuiChatBoxFocus) {
|
||||
for (int i = 0; i < MAX_BINDS; i++) {
|
||||
if (scancode == (int)configKeyConsole[i]) { djui_console_toggle(); break; }
|
||||
|
|
@ -304,6 +300,10 @@ void djui_interactable_on_key_up(int scancode) {
|
|||
}
|
||||
}
|
||||
|
||||
bool keyFocused = (gInteractableFocus != NULL)
|
||||
&& (gInteractableFocus->interactable != NULL)
|
||||
&& (gInteractableFocus->interactable->on_key_up != NULL);
|
||||
|
||||
if (keyFocused) {
|
||||
gInteractableFocus->interactable->on_key_up(gInteractableFocus, scancode);
|
||||
sKeyboardHoldDirection = PAD_HOLD_DIR_NONE;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue