diff options
author | linencloth <none@none> | 2010-10-25 02:31:19 +0200 |
---|---|---|
committer | linencloth <none@none> | 2010-10-25 02:31:19 +0200 |
commit | 2d692e9e87d8b2b438fd21dfae6749d573c4d5b8 (patch) | |
tree | 9ef43a28f1b04767cd33fb87eab9f32c591920e4 /src | |
parent | 3742e8ddec39e82ee5ce2d596433077beae7902d (diff) |
Core/DBLayer: Optimize waypoint script loading
--HG--
branch : trunk
Diffstat (limited to 'src')
-rwxr-xr-x | src/server/game/Globals/ObjectMgr.cpp | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index 762631dee6e..82ac6d13acb 100755 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -5168,12 +5168,26 @@ void ObjectMgr::LoadWaypointScripts() { LoadScripts(SCRIPTS_WAYPOINT); + std::set<uint32> actionSet; + for (ScriptMapMap::const_iterator itr = sWaypointScripts.begin(); itr != sWaypointScripts.end(); ++itr) + actionSet.insert(itr->first); + + QueryResult result = WorldDatabase.PQuery("SELECT DISTINCT(`action`) FROM waypoint_data"); + if (result) { - QueryResult query = WorldDatabase.PQuery("SELECT * FROM waypoint_data WHERE action = %u", itr->first); - if (!query || !query->GetRowCount()) - sLog.outErrorDb("There is no waypoint which links to the waypoint script %u", itr->first); + do + { + Field *fields = result->Fetch(); + uint32 action = fields[0].GetUInt32(); + + actionSet.erase(action); + + } while (result->NextRow()); } + + for (std::set<uint32>::iterator itr = actionSet.begin(); itr != actionSet.end(); ++itr) + sLog.outErrorDb("There is no waypoint which links to the waypoint script %u", *itr); } void ObjectMgr::LoadSpellScriptNames() |