Compare commits

...

2 Commits

Author SHA1 Message Date
45ab161f22 Back to my fork.
All checks were successful
continuous-integration/drone/push Build is passing
2023-05-09 08:43:45 -05:00
5a3ce9b790 Zero out vectors instead of setting to None. 2023-05-09 08:43:31 -05:00
2 changed files with 5 additions and 4 deletions

View File

@ -31,7 +31,7 @@ coord_2d = "0.3"
futures-lite = "1"
gilrs = "0.10"
here_be_dragons = { version = "0.3", features = ["serde"] }
leafwing-input-manager = "0.9"
leafwing-input-manager = { git = "https://github.com/ndarilek/leafwing-input-manager", branch = "consume" }
maze_generator = "2"
once_cell = "1"
pathfinding = "4"

View File

@ -217,7 +217,8 @@ fn controls(
trace!("{entity:?}: Stopped moving");
actions.release(NavigationAction::SetLinearVelocity);
actions.release(NavigationAction::Translate);
actions.action_data_mut(NavigationAction::Move).axis_pair = None;
actions.action_data_mut(NavigationAction::Move).axis_pair =
Some(DualAxisData::from_xy(Vec2::ZERO));
}
if actions.pressed(NavigationAction::SetLinearVelocity) {
if let Some(pair) = actions.axis_pair(NavigationAction::SetLinearVelocity) {
@ -232,7 +233,7 @@ fn controls(
velocity.linvel = Vec2::ZERO;
actions
.action_data_mut(NavigationAction::SetLinearVelocity)
.axis_pair = None;
.axis_pair = Some(DualAxisData::from_xy(Vec2::ZERO));
}
if actions.pressed(NavigationAction::Translate) {
if let Some(pair) = actions.axis_pair(NavigationAction::Translate) {
@ -246,7 +247,7 @@ fn controls(
}
actions
.action_data_mut(NavigationAction::Translate)
.axis_pair = None;
.axis_pair = Some(DualAxisData::from_xy(Vec2::ZERO));
}
if !snap_timers.contains_key(&entity) {
if let Some(rotation_speed) = rotation_speed {