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,
|
_ => None,
|
||||||
};
|
};
|
||||||
|
|
||||||
match (active_tool_hands, second_tool_hands) {
|
let equip_slot = match (active_tool_hands, second_tool_hands) {
|
||||||
(Some(Hands::TwoHand), _) => {
|
(Some(Hands::TwoHand), _) => Some(EquipSlot::Mainhand),
|
||||||
if let Some(ability) = data
|
(_, Some(Hands::OneHand)) => Some(EquipSlot::Offhand),
|
||||||
.inventory
|
(Some(Hands::OneHand), _) => Some(EquipSlot::Mainhand),
|
||||||
.equipped(EquipSlot::Mainhand)
|
(_, _) => None,
|
||||||
.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();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
(_, _) => {},
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
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)) {
|
let tool = match (active_tool.map(|x| x.hands), second_tool.map(|x| x.hands)) {
|
||||||
(Some(Hands::TwoHand), _) => active_tool,
|
(Some(Hands::TwoHand), _) => active_tool,
|
||||||
(_, Some(Hands::OneHand)) => second_tool,
|
(_, Some(Hands::OneHand)) => second_tool,
|
||||||
|
(Some(Hands::OneHand), _) => active_tool,
|
||||||
(_, _) => None,
|
(_, _) => None,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user