From 48d1e8bd4e5ebcaf55dc465d9392df0e05405464 Mon Sep 17 00:00:00 2001 From: Rémi Verschelde Date: Fri, 2 Sep 2016 20:31:06 +0200 Subject: InputEvent: Fix event comparisons when type is NONE Was a regression from 2e5a4cb5ca33576ea81601f949b2e633ff92213c. Fixes #6376. (cherry picked from commit eff6519aafab0750d10978e9b0b6c51e0fac6862) --- core/os/input_event.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/core/os/input_event.cpp b/core/os/input_event.cpp index f4a6de0e9..9d920724e 100644 --- a/core/os/input_event.cpp +++ b/core/os/input_event.cpp @@ -39,6 +39,8 @@ bool InputEvent::operator==(const InputEvent &p_event) const { } switch(type) { + case NONE: + return true; case KEY: return key.unicode == p_event.key.unicode && key.scancode == p_event.key.scancode @@ -77,6 +79,8 @@ bool InputEvent::operator==(const InputEvent &p_event) const { case ACTION: return action.action == p_event.action.action && action.pressed == p_event.action.pressed; + default: + ERR_PRINT("No logic to compare InputEvents of this type, this shouldn't happen."); } return false; -- cgit v1.3.1