From 3e4b40380ffcf553e8db525e9a75000529a94912 Mon Sep 17 00:00:00 2001 From: Shane Handley Date: Thu, 2 Apr 2020 14:47:26 +1100 Subject: [PATCH] fix: Restore run SFX when the character is using a weapon other than the sword. --- .../src/audio/sfx/event_mapper/movement/mod.rs | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/voxygen/src/audio/sfx/event_mapper/movement/mod.rs b/voxygen/src/audio/sfx/event_mapper/movement/mod.rs index 8f4a6d2916..36dc653303 100644 --- a/voxygen/src/audio/sfx/event_mapper/movement/mod.rs +++ b/voxygen/src/audio/sfx/event_mapper/movement/mod.rs @@ -98,17 +98,14 @@ impl MovementEventMapper { Some(Self::get_volume_for_body_type(body)), )); - // Set the new previous entity state - state.event = mapped_event; state.time = Instant::now(); - state.weapon_drawn = Self::weapon_drawn(character); - state.on_ground = physics.on_ground; - } else { - // If we don't dispatch the event, store this data as we can use it to determine - // the next event - state.event = mapped_event; - state.on_ground = physics.on_ground; } + + // update state to determine the next event. We only record the time (above) if + // it was dispatched + state.event = mapped_event; + state.weapon_drawn = Self::weapon_drawn(character); + state.on_ground = physics.on_ground; } }