aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorclick <none@none>2010-05-01 08:10:14 +0200
committerclick <none@none>2010-05-01 08:10:14 +0200
commit3a616674921763c5cf3f3409dbd1fe06251ec9c2 (patch)
tree8413f86248f603d5a74e6ab87b4b659266e5b9e3 /src
parentea2d4d95366fa74415e90bf3dd551697ec2a0eaa (diff)
Add support for sorting vendor itemlists
--HG-- branch : trunk
Diffstat (limited to 'src')
-rw-r--r--src/game/GameEventMgr.cpp2
-rw-r--r--src/game/ObjectMgr.cpp4
2 files changed, 3 insertions, 3 deletions
diff --git a/src/game/GameEventMgr.cpp b/src/game/GameEventMgr.cpp
index 965651ae2f6..c285376ffd3 100644
--- a/src/game/GameEventMgr.cpp
+++ b/src/game/GameEventMgr.cpp
@@ -823,7 +823,7 @@ void GameEventMgr::LoadFromDB()
sLog.outString("Loading Game Event Vendor Additions Data...");
// 0 1 2 3 4 5
- result = WorldDatabase.Query("SELECT event, guid, item, maxcount, incrtime, ExtendedCost FROM game_event_npc_vendor");
+ result = WorldDatabase.Query("SELECT event, guid, item, maxcount, incrtime, ExtendedCost FROM game_event_npc_vendor ORDER BY guid, slot ASC");
count = 0;
if (!result)
diff --git a/src/game/ObjectMgr.cpp b/src/game/ObjectMgr.cpp
index 94d735f10f0..54ed69417dc 100644
--- a/src/game/ObjectMgr.cpp
+++ b/src/game/ObjectMgr.cpp
@@ -8252,7 +8252,7 @@ void ObjectMgr::LoadTrainerSpell()
int ObjectMgr::LoadReferenceVendor(int32 vendor, int32 item, std::set<uint32> *skip_vendors)
{
// find all items from the reference vendor
- QueryResult_AutoPtr result = WorldDatabase.PQuery("SELECT item, maxcount, incrtime, ExtendedCost FROM npc_vendor WHERE entry='%d'", item);
+ QueryResult_AutoPtr result = WorldDatabase.PQuery("SELECT item, maxcount, incrtime, ExtendedCost FROM npc_vendor WHERE entry='%d' ORDER BY slot ASC", item);
if (!result)
{
barGoLink bar(1);
@@ -8303,7 +8303,7 @@ void ObjectMgr::LoadVendors()
std::set<uint32> skip_vendors;
- QueryResult_AutoPtr result = WorldDatabase.Query("SELECT entry, item, maxcount, incrtime, ExtendedCost FROM npc_vendor");
+ QueryResult_AutoPtr result = WorldDatabase.Query("SELECT entry, item, maxcount, incrtime, ExtendedCost FROM npc_vendor ORDER BY entry, slot ASC");
if (!result)
{
barGoLink bar(1);