mirror of
https://github.com/mangosfour/server.git
synced 2025-12-15 19:37:02 +00:00
[10744] Prevent equip/unequip items in process logout
Signed-off-by: VladimirMangos <vladimir@getmangos.com>
This commit is contained in:
parent
355f172fc6
commit
62c448b466
2 changed files with 9 additions and 1 deletions
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#ifndef __REVISION_NR_H__
|
||||
#define __REVISION_NR_H__
|
||||
#define REVISION_NR "10743"
|
||||
#define REVISION_NR "10744"
|
||||
#endif // __REVISION_NR_H__
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue