[10751] Use objectguids in item code.

Also
* Fixed unexpected container updated state after inventory load
* Make .debug getitemstate command more friendly by args.
This commit is contained in:
VladimirMangos 2010-11-19 23:43:06 +03:00
parent bbd34562a8
commit 2601022b9f
14 changed files with 173 additions and 110 deletions

View file

@ -513,10 +513,10 @@ void WorldSession::HandleSellItemOpcode( WorldPacket & recv_data )
GetPlayer()->RemoveSpellsCausingAura(SPELL_AURA_FEIGN_DEATH);
Item *pItem = _player->GetItemByGuid( itemguid );
if( pItem )
if (pItem)
{
// prevent sell not owner item
if(_player->GetGUID() != pItem->GetOwnerGUID())
if (_player->GetObjectGuid() != pItem->GetOwnerGuid())
{
_player->SendSellError( SELL_ERR_CANT_SELL_ITEM, pCreature, itemguid, 0);
return;
@ -1189,7 +1189,7 @@ void WorldSession::HandleWrapItemOpcode(WorldPacket& recv_data)
}
CharacterDatabase.BeginTransaction();
CharacterDatabase.PExecute("INSERT INTO character_gifts VALUES ('%u', '%u', '%u', '%u')", GUID_LOPART(item->GetOwnerGUID()), item->GetGUIDLow(), item->GetEntry(), item->GetUInt32Value(ITEM_FIELD_FLAGS));
CharacterDatabase.PExecute("INSERT INTO character_gifts VALUES ('%u', '%u', '%u', '%u')", item->GetOwnerGuid().GetCounter(), item->GetGUIDLow(), item->GetEntry(), item->GetUInt32Value(ITEM_FIELD_FLAGS));
item->SetEntry(gift->GetEntry());
switch (item->GetEntry())