Core/Player: correct logic for IsUsingTwoHandedWeaponInOneHand

Fixes penalty not being applied when we are using a 2H in offhand, and a unarmed MH.
MH may do unarmed attacks in this case. (reciprocal of 2H MH, unarmed OH, only uses MH normally, OH doesn't unarmed attack)
This commit is contained in:
ariel- authored and Aokromes committed 2016-10-03 14:57:51 +02:00
1 parent bcfe5b4f4f
commit 6ee820afe4
1 file changed
+5 -4
+5 -4
View File
@@ -13172,14 +13172,15 @@ bool Player::IsTwoHandUsed() const
bool Player::IsUsingTwoHandedWeaponInOneHand() const
{
Item* mainItem = GetItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_MAINHAND);
Item* offItem = GetItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_OFFHAND);
if (offItem && offItem->GetTemplate()->InventoryType == INVTYPE_2HWEAPON)
return true;
if (!mainItem || !offItem)
Item* mainItem = GetItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_MAINHAND);
if (!mainItem || mainItem->GetTemplate()->InventoryType != INVTYPE_2HWEAPON)
return false;
if (mainItem->GetTemplate()->InventoryType != INVTYPE_2HWEAPON &&
offItem->GetTemplate()->InventoryType != INVTYPE_2HWEAPON)
if (!offItem)
return false;
return true;