diff options
author | Marco F <51234379+MarcoFazioRandom@users.noreply.github.com> | 2022-03-01 16:25:57 +0100 |
---|---|---|
committer | RĂ©mi Verschelde <rverschelde@gmail.com> | 2022-06-28 15:58:26 +0200 |
commit | 0efa5d4cbd1a0fbbe6c23c9f9e30015d7116412f (patch) | |
tree | 39d3cdd6bcc3a011dee3712d3bc96d4ce0e215f0 /core/input | |
parent | 2d28bb83642d1922785bd64a2b276c50793dd4de (diff) |
Input: Make `get_action_raw_strength` print error when the action doesn't exist
Diffstat (limited to 'core/input')
-rw-r--r-- | core/input/input.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/core/input/input.cpp b/core/input/input.cpp index b3a68bb98c..da0c6cb62a 100644 --- a/core/input/input.cpp +++ b/core/input/input.cpp @@ -325,6 +325,7 @@ float Input::get_action_strength(const StringName &p_action, bool p_exact) const } float Input::get_action_raw_strength(const StringName &p_action, bool p_exact) const { + ERR_FAIL_COND_V_MSG(!InputMap::get_singleton()->has_action(p_action), 0.0, InputMap::get_singleton()->suggest_actions(p_action)); HashMap<StringName, Action>::ConstIterator E = action_state.find(p_action); if (!E) { return 0.0f; |