mirror of
https://github.com/mangosfour/server.git
synced 2025-12-13 13:37:05 +00:00
[6959] Merge some queries on item load.
Signed-off-by: hunuza <hunuza@gmail.com>
This commit is contained in:
parent
40e540d6f8
commit
70c7dda068
4 changed files with 24 additions and 20 deletions
|
|
@ -1892,7 +1892,8 @@ void ObjectMgr::LoadItemPrototypes()
|
|||
|
||||
void ObjectMgr::LoadAuctionItems()
|
||||
{
|
||||
QueryResult *result = CharacterDatabase.Query( "SELECT itemguid,item_template FROM auctionhouse" );
|
||||
// data needs to be at first place for Item::LoadFromDB
|
||||
QueryResult *result = CharacterDatabase.Query( "SELECT data,itemguid,item_template FROM auctionhouse JOIN item_instance ON itemguid = guid" );
|
||||
|
||||
if( !result )
|
||||
return;
|
||||
|
|
@ -1907,8 +1908,8 @@ void ObjectMgr::LoadAuctionItems()
|
|||
bar.step();
|
||||
|
||||
fields = result->Fetch();
|
||||
uint32 item_guid = fields[0].GetUInt32();
|
||||
uint32 item_template = fields[1].GetUInt32();
|
||||
uint32 item_guid = fields[1].GetUInt32();
|
||||
uint32 item_template = fields[2].GetUInt32();
|
||||
|
||||
ItemPrototype const *proto = GetItemPrototype(item_template);
|
||||
|
||||
|
|
@ -1920,7 +1921,7 @@ void ObjectMgr::LoadAuctionItems()
|
|||
|
||||
Item *item = NewItemOrBag(proto);
|
||||
|
||||
if(!item->LoadFromDB(item_guid,0))
|
||||
if(!item->LoadFromDB(item_guid,0, result))
|
||||
{
|
||||
delete item;
|
||||
continue;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue