From 88d68df2c0f63f5874072ec866995f796f800058 Mon Sep 17 00:00:00 2001 From: scott-c Date: Wed, 17 Jun 2020 21:34:58 +0800 Subject: [PATCH] Remove wield requirement to swap loadout --- CHANGELOG.md | 2 ++ client/src/lib.rs | 14 +------------- common/src/comp/character_state.rs | 7 ------- 3 files changed, 3 insertions(+), 20 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 086b25c678..25f94fb983 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -40,6 +40,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Removed +- Wield requirement to swap loadout; fixes issue with unable swap loadout outside of combat. + ## [0.6.0] - 2020-05-16 ### Added diff --git a/client/src/lib.rs b/client/src/lib.rs index a628fd96f7..a49e29eba0 100644 --- a/client/src/lib.rs +++ b/client/src/lib.rs @@ -354,19 +354,7 @@ impl Client { /// Checks whether a player can swap their weapon+ability `Loadout` settings /// and sends the `ControlAction` event that signals to do the swap. - pub fn swap_loadout(&mut self) { - let can_swap = self - .state - .ecs() - .read_storage::() - .get(self.entity) - .map(|cs| cs.can_swap()); - match can_swap { - Some(true) => self.control_action(ControlAction::SwapLoadout), - Some(false) => {}, - None => warn!("Can't swap, client entity doesn't have a `CharacterState`"), - } - } + pub fn swap_loadout(&mut self) { self.control_action(ControlAction::SwapLoadout) } pub fn toggle_wield(&mut self) { let is_wielding = self diff --git a/common/src/comp/character_state.rs b/common/src/comp/character_state.rs index f2cdcbb5b7..5af32477d9 100644 --- a/common/src/comp/character_state.rs +++ b/common/src/comp/character_state.rs @@ -76,13 +76,6 @@ impl CharacterState { } } - pub fn can_swap(&self) -> bool { - match self { - CharacterState::Wielding => true, - _ => false, - } - } - pub fn is_attack(&self) -> bool { match self { CharacterState::BasicMelee(_)