aboutsummaryrefslogtreecommitdiff
path: root/src/game/Guild.cpp
diff options
context:
space:
mode:
authormegamage <none@none>2008-12-28 12:10:31 -0600
committermegamage <none@none>2008-12-28 12:10:31 -0600
commite2ee47fb355c3ff59c54cd1bd3f2c8b329c8a108 (patch)
tree806cf365e082008f8b2a22c37f2076d4de7c0006 /src/game/Guild.cpp
parent3bbf8d6be8cd67d99fc8c1df3a971fe4e7e680ef (diff)
*Update to Mangos 6963.
--HG-- branch : trunk
Diffstat (limited to 'src/game/Guild.cpp')
-rw-r--r--src/game/Guild.cpp15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/game/Guild.cpp b/src/game/Guild.cpp
index 55ad071a74b..a34d4bee524 100644
--- a/src/game/Guild.cpp
+++ b/src/game/Guild.cpp
@@ -1213,18 +1213,19 @@ void Guild::LoadGuildBankFromDB()
delete result;
- // 0 1 2 3
- result = CharacterDatabase.PQuery("SELECT TabId, SlotId, item_guid, item_entry FROM guild_bank_item WHERE guildid='%u' ORDER BY TabId", Id);
+ // data needs to be at first place for Item::LoadFromDB
+ // 0 1 2 3 4
+ result = CharacterDatabase.PQuery("SELECT data, TabId, SlotId, item_guid, item_entry FROM guild_bank_item JOIN item_instance ON item_guid = guid WHERE guildid='%u' ORDER BY TabId", Id);
if(!result)
return;
do
{
Field *fields = result->Fetch();
- uint8 TabId = fields[0].GetUInt8();
- uint8 SlotId = fields[1].GetUInt8();
- uint32 ItemGuid = fields[2].GetUInt32();
- uint32 ItemEntry = fields[3].GetUInt32();
+ uint8 TabId = fields[1].GetUInt8();
+ uint8 SlotId = fields[2].GetUInt8();
+ uint32 ItemGuid = fields[3].GetUInt32();
+ uint32 ItemEntry = fields[4].GetUInt32();
if (TabId >= purchased_tabs || TabId >= GUILD_BANK_MAX_TABS)
{
@@ -1247,7 +1248,7 @@ void Guild::LoadGuildBankFromDB()
}
Item *pItem = NewItemOrBag(proto);
- if(!pItem->LoadFromDB(ItemGuid, 0))
+ if(!pItem->LoadFromDB(ItemGuid, 0, result))
{
CharacterDatabase.PExecute("DELETE FROM guild_bank_item WHERE guildid='%u' AND TabId='%u' AND SlotId='%u'", Id, uint32(TabId), uint32(SlotId));
sLog.outError("Item GUID %u not found in item_instance, deleting from Guild Bank!", ItemGuid);