From 4e5310cc60dc17e5ef09e57115ca8236544679e4 Mon Sep 17 00:00:00 2001 From: qarmin Date: Wed, 26 Jun 2019 15:08:25 +0200 Subject: Some code changed with Clang-Tidy --- core/os/input_event.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'core/os/input_event.cpp') diff --git a/core/os/input_event.cpp b/core/os/input_event.cpp index 9c5066da3d..a40a50cfce 100644 --- a/core/os/input_event.cpp +++ b/core/os/input_event.cpp @@ -314,7 +314,7 @@ bool InputEventKey::action_match(const Ref &p_event, bool *p_pressed if (p_pressed != NULL) *p_pressed = key->is_pressed(); if (p_strength != NULL) - *p_strength = (*p_pressed) ? 1.0f : 0.0f; + *p_strength = (p_pressed != NULL && *p_pressed) ? 1.0f : 0.0f; } return match; } @@ -483,7 +483,7 @@ bool InputEventMouseButton::action_match(const Ref &p_event, bool *p if (p_pressed != NULL) *p_pressed = mb->is_pressed(); if (p_strength != NULL) - *p_strength = (*p_pressed) ? 1.0f : 0.0f; + *p_strength = (p_pressed != NULL && *p_pressed) ? 1.0f : 0.0f; } return match; @@ -795,7 +795,7 @@ bool InputEventJoypadButton::action_match(const Ref &p_event, bool * if (p_pressed != NULL) *p_pressed = jb->is_pressed(); if (p_strength != NULL) - *p_strength = (*p_pressed) ? 1.0f : 0.0f; + *p_strength = (p_pressed != NULL && *p_pressed) ? 1.0f : 0.0f; } return match; @@ -1041,7 +1041,7 @@ bool InputEventAction::action_match(const Ref &p_event, bool *p_pres if (p_pressed != NULL) *p_pressed = act->pressed; if (p_strength != NULL) - *p_strength = (*p_pressed) ? 1.0f : 0.0f; + *p_strength = (p_pressed != NULL && *p_pressed) ? 1.0f : 0.0f; } return match; } -- cgit v1.2.3