Core/DBLayer: Optimize waypoint script loading
--HG-- branch : trunk
This commit is contained in:
@@ -5168,12 +5168,26 @@ void ObjectMgr::LoadWaypointScripts()
|
|||||||
{
|
{
|
||||||
LoadScripts(SCRIPTS_WAYPOINT);
|
LoadScripts(SCRIPTS_WAYPOINT);
|
||||||
|
|
||||||
|
std::set<uint32> actionSet;
|
||||||
|
|
||||||
for (ScriptMapMap::const_iterator itr = sWaypointScripts.begin(); itr != sWaypointScripts.end(); ++itr)
|
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);
|
do
|
||||||
if (!query || !query->GetRowCount())
|
{
|
||||||
sLog.outErrorDb("There is no waypoint which links to the waypoint script %u", itr->first);
|
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()
|
void ObjectMgr::LoadSpellScriptNames()
|
||||||
|
|||||||
Reference in New Issue
Block a user