mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-17 19:05:42 +00:00
fix(Core/PlayerStorage): Equip OH, 2H, Titan's Grip weapon swapping (#19884)
titan's grip, unequip with full bags
This commit is contained in:
@@ -12426,6 +12426,14 @@ void Player::AutoUnequipOffhandIfNeed(bool force /*= false*/)
|
||||
if (!CanDualWield() && (offItem->GetTemplate()->InventoryType == INVTYPE_WEAPONOFFHAND || offItem->GetTemplate()->InventoryType == INVTYPE_WEAPON))
|
||||
force = true;
|
||||
|
||||
// unequip offhand weapon if player main hand weapon is a polearm or staff or fishing pole
|
||||
if (Item* mhWeapon = GetItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_MAINHAND))
|
||||
if (ItemTemplate const* mhWeaponProto = mhWeapon->GetTemplate())
|
||||
if (mhWeaponProto->SubClass == ITEM_SUBCLASS_WEAPON_POLEARM ||
|
||||
mhWeaponProto->SubClass == ITEM_SUBCLASS_WEAPON_STAFF ||
|
||||
mhWeaponProto->SubClass == ITEM_SUBCLASS_WEAPON_FISHING_POLE)
|
||||
force = true;
|
||||
|
||||
// need unequip offhand for 2h-weapon without TitanGrip (in any from hands)
|
||||
if (!force && (CanTitanGrip() || (offItem->GetTemplate()->InventoryType != INVTYPE_2HWEAPON && !IsTwoHandUsed())))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user