1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-04 12:00:25 +00:00

Add event_index to InputEventAction

This commit is contained in:
kobewi
2023-12-10 19:23:29 +01:00
parent 60844997bb
commit 17d3f26e5d
5 changed files with 27 additions and 1 deletions

View File

@@ -1244,7 +1244,7 @@ void Input::_update_action_cache(const StringName &p_action_name, ActionState &r
r_action_state.cache.strength = 0.0;
r_action_state.cache.raw_strength = 0.0;
int max_event = InputMap::get_singleton()->action_get_events(p_action_name)->size();
int max_event = InputMap::get_singleton()->action_get_events(p_action_name)->size() + 1; // +1 comes from InputEventAction.
for (const KeyValue<int, ActionState::DeviceState> &kv : r_action_state.device_states) {
const ActionState::DeviceState &device_state = kv.value;
for (int i = 0; i < max_event; i++) {