Input: Make `get_action_raw_strength` print error when the action doesn't exist

This commit is contained in:
Marco F 2022-03-01 16:25:57 +01:00 committed by Rémi Verschelde
parent 2d28bb8364
commit 0efa5d4cbd
1 changed files with 1 additions and 0 deletions

View File

@ -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;