mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Wielding a 1 handed weapon now correctly uses abilities when the second weapon is not also a 1 handed weapon.
This commit is contained in:
parent
f50fa25467
commit
6f6a37faf2
@ -436,37 +436,27 @@ pub fn handle_ability2_input(data: &JoinData, update: &mut StateUpdate) {
|
||||
_ => None,
|
||||
};
|
||||
|
||||
match (active_tool_hands, second_tool_hands) {
|
||||
(Some(Hands::TwoHand), _) => {
|
||||
if let Some(ability) = data
|
||||
.inventory
|
||||
.equipped(EquipSlot::Mainhand)
|
||||
.map(|i| &i.item_config_expect().abilities.secondary)
|
||||
.map(|a| {
|
||||
let tool = unwrap_tool_data(data).map(|t| t.kind);
|
||||
a.clone().adjusted_by_skills(&data.stats.skill_set, tool)
|
||||
})
|
||||
.filter(|ability| ability.requirements_paid(data, update))
|
||||
{
|
||||
update.character = (&ability, AbilityKey::Mouse2).into();
|
||||
}
|
||||
},
|
||||
(_, Some(Hands::OneHand)) => {
|
||||
if let Some(ability) = data
|
||||
.inventory
|
||||
.equipped(EquipSlot::Offhand)
|
||||
.map(|i| &i.item_config_expect().abilities.secondary)
|
||||
.map(|a| {
|
||||
let tool = unwrap_tool_data(data).map(|t| t.kind);
|
||||
a.clone().adjusted_by_skills(&data.stats.skill_set, tool)
|
||||
})
|
||||
.filter(|ability| ability.requirements_paid(data, update))
|
||||
{
|
||||
update.character = (&ability, AbilityKey::Mouse2).into();
|
||||
}
|
||||
},
|
||||
(_, _) => {},
|
||||
let equip_slot = match (active_tool_hands, second_tool_hands) {
|
||||
(Some(Hands::TwoHand), _) => Some(EquipSlot::Mainhand),
|
||||
(_, Some(Hands::OneHand)) => Some(EquipSlot::Offhand),
|
||||
(Some(Hands::OneHand), _) => Some(EquipSlot::Mainhand),
|
||||
(_, _) => None,
|
||||
};
|
||||
|
||||
if let Some(equip_slot) = equip_slot {
|
||||
if let Some(ability) = data
|
||||
.inventory
|
||||
.equipped(equip_slot)
|
||||
.map(|i| &i.item_config_expect().abilities.secondary)
|
||||
.map(|a| {
|
||||
let tool = unwrap_tool_data(data).map(|t| t.kind);
|
||||
a.clone().adjusted_by_skills(&data.stats.skill_set, tool)
|
||||
})
|
||||
.filter(|ability| ability.requirements_paid(data, update))
|
||||
{
|
||||
update.character = (&ability, AbilityKey::Mouse2).into();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -590,6 +590,7 @@ impl<'a> Widget for Skillbar<'a> {
|
||||
let tool = match (active_tool.map(|x| x.hands), second_tool.map(|x| x.hands)) {
|
||||
(Some(Hands::TwoHand), _) => active_tool,
|
||||
(_, Some(Hands::OneHand)) => second_tool,
|
||||
(Some(Hands::OneHand), _) => active_tool,
|
||||
(_, _) => None,
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user