*Fix a bug that GetScriptId returns incorrect id when the scriptname does not exist in db. Thank peldor for pointing out the mistake.

--HG--
branch : trunk
This commit is contained in:
megamage
2008-11-24 19:41:39 -06:00
parent f7e5b2ba69
commit 52f2e35d65
+1 -1
View File
@@ -7434,7 +7434,7 @@ uint32 ObjectMgr::GetScriptId(const char *name)
if(!name) return 0; if(!name) return 0;
ScriptNameMap::const_iterator itr = ScriptNameMap::const_iterator itr =
std::lower_bound(m_scriptNames.begin(), m_scriptNames.end(), name); std::lower_bound(m_scriptNames.begin(), m_scriptNames.end(), name);
if(itr == m_scriptNames.end()) return 0; if(itr == m_scriptNames.end() || *itr != name) return 0;
return itr - m_scriptNames.begin(); return itr - m_scriptNames.begin();
} }