[10744] Prevent equip/unequip items in process logout

Signed-off-by: VladimirMangos <vladimir@getmangos.com>
This commit is contained in:
Den 2010-11-19 06:16:54 +03:00 committed by VladimirMangos
parent 355f172fc6
commit 62c448b466
2 changed files with 9 additions and 1 deletions

View file

@ -10361,6 +10361,10 @@ uint8 Player::CanEquipItem( uint8 slot, uint16 &dest, Item *pItem, bool swap, bo
return EQUIP_ERR_NOT_DURING_ARENA_MATCH;
}
// prevent equip item in process logout
if (GetSession()->isLogingOut())
return EQUIP_ERR_YOU_ARE_STUNNED;
if (isInCombat()&& pProto->Class == ITEM_CLASS_WEAPON && m_weaponChangeTimer != 0)
return EQUIP_ERR_CANT_DO_RIGHT_NOW; // maybe exist better err
@ -10492,6 +10496,10 @@ uint8 Player::CanUnequipItem( uint16 pos, bool swap ) const
return EQUIP_ERR_NOT_DURING_ARENA_MATCH;
}
// prevent unequip item in process logout
if (GetSession()->isLogingOut())
return EQUIP_ERR_YOU_ARE_STUNNED;
if(!swap && pItem->IsBag() && !((Bag*)pItem)->IsEmpty())
return EQUIP_ERR_CAN_ONLY_DO_WITH_EMPTY_BAGS;