[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

@ -1174,7 +1174,7 @@ void Guild::LoadGuildBankFromDB()
}
Item *pItem = NewItemOrBag(proto);
if (!pItem->LoadFromDB(ItemGuid, 0, fields))
if (!pItem->LoadFromDB(ItemGuid, fields))
{
CharacterDatabase.PExecute("DELETE FROM guild_bank_item WHERE guildid='%u' AND TabId='%u' AND SlotId='%u'", m_Id, uint32(TabId), uint32(SlotId));
sLog.outError("Item GUID %u not found in item_instance, deleting from Guild Bank!", ItemGuid);
@ -1705,8 +1705,8 @@ Item* Guild::_StoreItem( uint8 tab, uint8 slot, Item *pItem, uint32 count, bool
m_TabListMap[tab]->Slots[slot] = pItem;
pItem->SetUInt64Value(ITEM_FIELD_CONTAINED, 0);
pItem->SetUInt64Value(ITEM_FIELD_OWNER, 0);
pItem->SetGuidValue(ITEM_FIELD_CONTAINED, ObjectGuid());
pItem->SetGuidValue(ITEM_FIELD_OWNER, ObjectGuid());
AddGBankItemToDB(GetId(), tab, slot, pItem->GetGUIDLow(), pItem->GetEntry());
pItem->FSetState(ITEM_NEW);
pItem->SaveToDB(); // not in inventory and can be save standalone