InputEvent: Fix event comparisons when type is NONE
Was a regression from2e5a4cb5ca
. Fixes #6376. (cherry picked from commiteff6519aaf
)
This commit is contained in:
parent
73b40d1457
commit
48d1e8bd4e
1 changed files with 4 additions and 0 deletions
|
@ -39,6 +39,8 @@ bool InputEvent::operator==(const InputEvent &p_event) const {
|
||||||
}
|
}
|
||||||
|
|
||||||
switch(type) {
|
switch(type) {
|
||||||
|
case NONE:
|
||||||
|
return true;
|
||||||
case KEY:
|
case KEY:
|
||||||
return key.unicode == p_event.key.unicode
|
return key.unicode == p_event.key.unicode
|
||||||
&& key.scancode == p_event.key.scancode
|
&& key.scancode == p_event.key.scancode
|
||||||
|
@ -77,6 +79,8 @@ bool InputEvent::operator==(const InputEvent &p_event) const {
|
||||||
case ACTION:
|
case ACTION:
|
||||||
return action.action == p_event.action.action
|
return action.action == p_event.action.action
|
||||||
&& action.pressed == p_event.action.pressed;
|
&& action.pressed == p_event.action.pressed;
|
||||||
|
default:
|
||||||
|
ERR_PRINT("No logic to compare InputEvents of this type, this shouldn't happen.");
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
|
Loading…
Reference in a new issue