Remove wield requirement to swap loadout

This commit is contained in:
scott-c 2020-06-17 21:34:58 +08:00
parent 71a49b0e22
commit 88d68df2c0
3 changed files with 3 additions and 20 deletions

View File

@ -40,6 +40,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Removed ### Removed
- Wield requirement to swap loadout; fixes issue with unable swap loadout outside of combat.
## [0.6.0] - 2020-05-16 ## [0.6.0] - 2020-05-16
### Added ### Added

View File

@ -354,19 +354,7 @@ impl Client {
/// Checks whether a player can swap their weapon+ability `Loadout` settings /// Checks whether a player can swap their weapon+ability `Loadout` settings
/// and sends the `ControlAction` event that signals to do the swap. /// and sends the `ControlAction` event that signals to do the swap.
pub fn swap_loadout(&mut self) { pub fn swap_loadout(&mut self) { self.control_action(ControlAction::SwapLoadout) }
let can_swap = self
.state
.ecs()
.read_storage::<comp::CharacterState>()
.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 toggle_wield(&mut self) { pub fn toggle_wield(&mut self) {
let is_wielding = self let is_wielding = self

View File

@ -76,13 +76,6 @@ impl CharacterState {
} }
} }
pub fn can_swap(&self) -> bool {
match self {
CharacterState::Wielding => true,
_ => false,
}
}
pub fn is_attack(&self) -> bool { pub fn is_attack(&self) -> bool {
match self { match self {
CharacterState::BasicMelee(_) CharacterState::BasicMelee(_)