aboutsummaryrefslogtreecommitdiff
path: root/src/game/ObjectMgr.cpp
diff options
context:
space:
mode:
authormegamage <none@none>2008-11-24 19:41:39 -0600
committermegamage <none@none>2008-11-24 19:41:39 -0600
commit52f2e35d65af17abfd9499232398bab338db78e1 (patch)
tree087d13438904fdcc2704e6e6c11056d1b5a7c6fe /src/game/ObjectMgr.cpp
parentf7e5b2ba69605b23ef918e53922839888983cacf (diff)
*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
Diffstat (limited to 'src/game/ObjectMgr.cpp')
-rw-r--r--src/game/ObjectMgr.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/game/ObjectMgr.cpp b/src/game/ObjectMgr.cpp
index e6fc35b21a4..9d95a995eed 100644
--- a/src/game/ObjectMgr.cpp
+++ b/src/game/ObjectMgr.cpp
@@ -7434,7 +7434,7 @@ uint32 ObjectMgr::GetScriptId(const char *name)
if(!name) return 0;
ScriptNameMap::const_iterator itr =
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();
}