From 19b66ed67f59d98f19722854259815be9e6c1b4e Mon Sep 17 00:00:00 2001 From: Shute052 Date: Tue, 20 Feb 2024 03:51:06 +0800 Subject: [PATCH] Reset the shorter clashed `ActionData` instead of removing it --- RELEASES.md | 1 + src/clashing_inputs.rs | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/RELEASES.md b/RELEASES.md index aa704621a..4111d1469 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -10,6 +10,7 @@ ### Bugs - fixed compilation issues with no-default-features +- fixed [a bug](https://github.com/Leafwing-Studios/leafwing-input-manager/issues/471) related to incorrect clash handling. ## Version 0.12 diff --git a/src/clashing_inputs.rs b/src/clashing_inputs.rs index 20a3cafa9..e9255c7a4 100644 --- a/src/clashing_inputs.rs +++ b/src/clashing_inputs.rs @@ -92,9 +92,9 @@ impl InputMap { clash_strategy: ClashStrategy, ) { for clash in self.get_clashes(action_data, input_streams) { - // Remove the action in the pair that was overruled, if any + // Reset the action in the pair that was overruled, if any if let Some(culled_action) = resolve_clash(&clash, clash_strategy, input_streams) { - action_data.remove(&culled_action); + action_data.insert(culled_action, ActionData::default()); } } }