fix(Core): Bag/Fishing pole equip (#1860)

* fix(Core): Bag/Fishing pole equip

- Fix bug When your bags are full and you equip a fishing pole, from 2x one handed weapon, it equip the fishing pole, than 1 weapon goes into bag and the other goes into the mailbox from "customer support".
-Do not allow equip 2 fishing poles for Warrior
This commit is contained in:
Poszer
2019-05-30 12:30:23 +02:00
committed by GitHub
parent fa9638a1b1
commit dfdedd36bb

View File

@@ -1710,7 +1710,7 @@ void Player::Update(uint32 p_time)
if (HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_RESTING))
{
if (now > m_Last_tick && _restTime > 0) // freeze update
if (now > m_Last_tick && _restTime > 0) // freeze update
{
time_t currTime = time(NULL);
time_t timeDiff = currTime - _restTime;
@@ -10244,7 +10244,7 @@ uint8 Player::FindEquipSlot(ItemTemplate const* proto, uint32 slot, bool swap) c
{
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)
if (mhWeaponProto->SubClass == ITEM_SUBCLASS_WEAPON_POLEARM || mhWeaponProto->SubClass == ITEM_SUBCLASS_WEAPON_STAFF)
{
const_cast<Player*>(this)->AutoUnequipOffhandIfNeed(true);
break;
@@ -10254,7 +10254,7 @@ uint8 Player::FindEquipSlot(ItemTemplate const* proto, uint32 slot, bool swap) c
if (GetItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_OFFHAND))
{
if (proto->SubClass == ITEM_SUBCLASS_WEAPON_POLEARM || proto->SubClass == ITEM_SUBCLASS_WEAPON_STAFF || proto->SubClass == ITEM_SUBCLASS_WEAPON_FISHING_POLE)
if (proto->SubClass == ITEM_SUBCLASS_WEAPON_POLEARM || proto->SubClass == ITEM_SUBCLASS_WEAPON_STAFF)
{
const_cast<Player*>(this)->AutoUnequipOffhandIfNeed(true);
break;