mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Remove wield requirement to swap loadout
This commit is contained in:
parent
71a49b0e22
commit
88d68df2c0
@ -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
|
||||||
|
@ -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
|
||||||
|
@ -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(_)
|
||||||
|
Loading…
Reference in New Issue
Block a user