[9227] More wide check item looting state at item operations.

Move some checks from packet handlers to Player::Can functions

Patch base at idea suggested originally by zhenya.
This commit is contained in:
VladimirMangos 2010-01-21 10:19:18 +03:00
parent 4e6befc43d
commit 4995a6d298
5 changed files with 104 additions and 102 deletions

View file

@ -150,13 +150,6 @@ void WorldSession::HandleAutoEquipItemOpcode( WorldPacket & recv_data )
if( !pSrcItem )
return; // only at cheat
if(pSrcItem->m_lootGenerated) // prevent swap looting item
{
//best error message found for attempting to swap while looting
_player->SendEquipError( EQUIP_ERR_CANT_DO_RIGHT_NOW, pSrcItem, NULL );
return;
}
uint16 dest;
uint8 msg = _player->CanEquipItem( NULL_SLOT, dest, pSrcItem, !pSrcItem->IsBag() );
if( msg != EQUIP_ERR_OK )