Skip to content

Commit 237479f

Browse files
committed
Merge pull request godotengine#89946 from wlsnmrk/action-press-strength-clamp
Fix `Input.action_press()` accepting out-of-bounds strength values
2 parents 669fc36 + 41e70db commit 237479f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

core/input/input.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -894,7 +894,7 @@ void Input::action_press(const StringName &p_action, float p_strength) {
894894
}
895895
action_state.exact = true;
896896
action_state.api_pressed = true;
897-
action_state.api_strength = p_strength;
897+
action_state.api_strength = CLAMP(p_strength, 0.0f, 1.0f);
898898
_update_action_cache(p_action, action_state);
899899
}
900900

0 commit comments

Comments
 (0)