File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed
src/server/game/Entities/Player Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -23528,15 +23528,21 @@ void Player::AutoUnequipOffhandIfNeed(bool force /*= false*/)
2352823528 if (!offItem)
2352923529 return;
2353023530
23531+ ItemTemplate const* offhandTemplate = offItem->GetTemplate();
23532+
2353123533 // unequip offhand weapon if player doesn't have dual wield anymore
23532- if (!CanDualWield() && (offItem->GetTemplate()-> InventoryType == INVTYPE_WEAPONOFFHAND || offItem->GetTemplate() ->InventoryType == INVTYPE_WEAPON))
23534+ if (!CanDualWield() && (offhandTemplate-> InventoryType == INVTYPE_WEAPONOFFHAND || offhandTemplate ->InventoryType == INVTYPE_WEAPON))
2353323535 force = true;
2353423536
2353523537 // need unequip offhand for 2h-weapon without TitanGrip (in any from hands)
23536- if (!force && CanTitanGrip(offItem) )
23538+ if (!force)
2353723539 {
2353823540 Item* mainItem = GetItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_MAINHAND);
23539- if (!mainItem || CanTitanGrip(mainItem))
23541+ if ((!mainItem || mainItem->GetTemplate()->InventoryType != INVTYPE_2HWEAPON)
23542+ && offhandTemplate->InventoryType != INVTYPE_2HWEAPON)
23543+ return;
23544+
23545+ if ((!mainItem || CanTitanGrip(mainItem)) && CanTitanGrip(offItem))
2354023546 return;
2354123547 }
2354223548
You can’t perform that action at this time.
0 commit comments