mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Fixes a bug where run sfx were being played during a roll.
This commit is contained in:
parent
697c7d734a
commit
825cf98a00
@ -32,6 +32,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
- Lanterns now stop glowing if you throw a lit one out of your inventory
|
||||
- Fixed a crash caused by certain audio devices on OSX
|
||||
- Bow animations now show held arrows
|
||||
- Fixed a bug where walk/run sfx played while a character rolled/dodged
|
||||
|
||||
### Removed
|
||||
|
||||
|
@ -149,16 +149,19 @@ impl MovementEventMapper {
|
||||
previous_state: &PreviousEntityState,
|
||||
vel: Vec3<f32>,
|
||||
) -> SfxEvent {
|
||||
// Match run state
|
||||
// Match run / roll state
|
||||
if physics_state.on_ground && vel.magnitude() > 0.1
|
||||
|| !previous_state.on_ground && physics_state.on_ground
|
||||
{
|
||||
return SfxEvent::Run;
|
||||
return if character_state.is_dodge() {
|
||||
SfxEvent::Roll
|
||||
} else {
|
||||
SfxEvent::Run
|
||||
};
|
||||
}
|
||||
|
||||
// Match all other Movemement and Action states
|
||||
match (previous_state.event, character_state) {
|
||||
(_, CharacterState::Roll { .. }) => SfxEvent::Roll,
|
||||
(_, CharacterState::Climb { .. }) => SfxEvent::Climb,
|
||||
(SfxEvent::Glide, CharacterState::Idle { .. }) => SfxEvent::GliderClose,
|
||||
(previous_event, CharacterState::Glide { .. }) => {
|
||||
|
@ -183,7 +183,7 @@ fn maps_roll() {
|
||||
time: Instant::now(),
|
||||
on_ground: true,
|
||||
},
|
||||
Vec3::zero(),
|
||||
Vec3::new(0.5, 0.5, 0.0),
|
||||
);
|
||||
|
||||
assert_eq!(result, SfxEvent::Roll);
|
||||
|
Loading…
Reference in New Issue
Block a user