Skip to content

Commit

Permalink
Fix get None
Browse files Browse the repository at this point in the history
  • Loading branch information
Shute052 committed Jan 30, 2024
1 parent be4ec97 commit 34ccc19
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/input_map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -326,9 +326,10 @@ impl<A: Actionlike> InputMap<A> {
let mut action_datum = ActionData::default();

for input in input_vec {
action_datum.axis_pair = input_streams.input_axis_pair(input).map(|new_data| {
new_data.merged_with(action_datum.axis_pair.unwrap_or_default())
});
if let Some(new_data) = input_streams.input_axis_pair(input) {
let current_data = action_datum.axis_pair.unwrap_or_default();
action_datum.axis_pair = Some(new_data.merged_with(current_data));
}

if input_streams.input_pressed(input) {
action_datum.state = ButtonState::JustPressed;
Expand Down

0 comments on commit 34ccc19

Please sign in to comment.