void WaypointManager::Unload() { for (WaypointPathMap::iterator itr = m_pathMap.begin(); itr != m_pathMap.end(); ++itr) _clearPath(itr->second); for (WaypointPathMap::iterator itr = m_pathTemplateMap.begin(); itr != m_pathTemplateMap.end(); ++itr) _clearPath(itr->second); m_pathMap.clear(); m_pathTemplateMap.clear(); }
void WaypointManager::DeletePath(uint32 id) { WorldDatabase.PExecuteLog("DELETE FROM creature_movement WHERE id=%u", id); WaypointPathMap::iterator itr = m_pathMap.find(id); if (itr != m_pathMap.end()) _clearPath(itr->second); // the path is not removed from the map, just cleared // WMGs have pointers to the path, so deleting them would crash // this wastes some memory, but these functions are // only meant to be called by GM commands }