diff options
author | Gyx <2359980687@qq.com> | 2012-03-28 20:00:29 +0800 |
---|---|---|
committer | Gyx <2359980687@qq.com> | 2012-03-28 20:00:29 +0800 |
commit | 1544b208da2c2c8522e711db38a598f08105fe51 (patch) | |
tree | f04ad31e6d5dc15df534194398652e4dd81a7f7c /src/server/game/Globals/ObjectMgr.cpp | |
parent | 72cdcbfcedafe223837c5011431373ef852a9c8b (diff) |
Core/Game: Code style again.
Signed-off-by: Gyx <2359980687@qq.com>
Diffstat (limited to 'src/server/game/Globals/ObjectMgr.cpp')
-rwxr-xr-x | src/server/game/Globals/ObjectMgr.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index d8107576ee4..aab1fc96521 100755 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -8598,10 +8598,13 @@ uint32 ObjectMgr::GetScriptId(const char *name) { // use binary search to find the script name in the sorted vector // assume "" is the first element - if (!name) return 0; - ScriptNameContainer::const_iterator itr = - std::lower_bound(_scriptNamesStore.begin(), _scriptNamesStore.end(), name); - if (itr == _scriptNamesStore.end() || *itr != name) return 0; + if (!name) + return 0; + + ScriptNameContainer::const_iterator itr = std::lower_bound(_scriptNamesStore.begin(), _scriptNamesStore.end(), name); + if (itr == _scriptNamesStore.end() || *itr != name) + return 0; + return uint32(itr - _scriptNamesStore.begin()); } @@ -8610,6 +8613,7 @@ void ObjectMgr::CheckScripts(ScriptsType type, std::set<int32>& ids) ScriptMapMap* scripts = GetScriptsMapByType(type); if (!scripts) return; + for (ScriptMapMap::const_iterator itrMM = scripts->begin(); itrMM != scripts->end(); ++itrMM) { for (ScriptMap::const_iterator itrM = itrMM->second.begin(); itrM != itrMM->second.end(); ++itrM) |