Fix GlideWield overriding state changes

This commit is contained in:
Ludvig Böklin 2021-06-22 11:20:40 +02:00
parent 2165fc7d2e
commit eddc967462

View File

@ -32,6 +32,8 @@ impl CharacterBehavior for Data {
handle_dodge_input(data, &mut update); handle_dodge_input(data, &mut update);
handle_wield(data, &mut update); handle_wield(data, &mut update);
// If still in this state, do the things
if matches!(update.character, CharacterState::GlideWield(_)) {
let mut glider = self.0; let mut glider = self.0;
glider.ori = glider.ori.slerped_towards( glider.ori = glider.ori.slerped_towards(
Ori::from(data.inputs.look_dir) Ori::from(data.inputs.look_dir)
@ -55,6 +57,7 @@ impl CharacterBehavior for Data {
} else { } else {
CharacterState::GlideWield(Self(glider)) CharacterState::GlideWield(Self(glider))
}; };
}
update update
} }