mirror of
https://github.com/mangosfour/server.git
synced 2025-12-13 04:37:00 +00:00
[9911] Check script using and existance at creature_movement_scripts load.
This commit is contained in:
parent
0828c3aa81
commit
112afc260c
5 changed files with 45 additions and 10 deletions
|
|
@ -394,3 +394,27 @@ void WaypointManager::CheckTextsExistance(std::set<int32>& ids)
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
void WaypointManager::CheckScriptExistance(std::set<uint32>& ids)
|
||||
{
|
||||
WaypointPathMap::iterator pmItr = m_pathMap.begin();
|
||||
for ( ; pmItr != m_pathMap.end(); ++pmItr)
|
||||
{
|
||||
for (size_t i = 0; i < pmItr->second.size(); ++i)
|
||||
{
|
||||
uint32 script_id = pmItr->second[i].script_id;
|
||||
if (!script_id)
|
||||
continue;
|
||||
|
||||
// Now we check text existence and put all zero texts ids to the end of array
|
||||
if (sCreatureMovementScripts.find(script_id)==sCreatureMovementScripts.end())
|
||||
{
|
||||
sLog.outErrorDb("Some waypoint has not existing scriptid %u.", script_id);
|
||||
pmItr->second[i].script_id = 0;
|
||||
continue;
|
||||
}
|
||||
else
|
||||
ids.erase(script_id);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue