summaryrefslogtreecommitdiff
path: root/src/game/Scripting/ScriptMgr.cpp
diff options
context:
space:
mode:
authorShinDarth <borzifrancesco@gmail.com>2016-08-24 01:14:28 +0200
committerShinDarth <borzifrancesco@gmail.com>2016-08-24 01:14:28 +0200
commitd538b86a4710ab056556e6ea144e4ed38b9ec6c2 (patch)
tree88444e38f121add1a5c44edd92ddeb697dc42a24 /src/game/Scripting/ScriptMgr.cpp
parent17061cbbb481122317a8a54aef508f3eca475a0b (diff)
Core/Chat: properly prevent crashes + cleaning (import from TrinityCore)
- Closes #111
Diffstat (limited to 'src/game/Scripting/ScriptMgr.cpp')
-rw-r--r--src/game/Scripting/ScriptMgr.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/game/Scripting/ScriptMgr.cpp b/src/game/Scripting/ScriptMgr.cpp
index 453e0b03a1..55dc8c3368 100644
--- a/src/game/Scripting/ScriptMgr.cpp
+++ b/src/game/Scripting/ScriptMgr.cpp
@@ -962,6 +962,12 @@ std::vector<ChatCommand> ScriptMgr::GetChatCommands()
table.insert(table.end(), cmds.begin(), cmds.end());
}
+ // Sort commands in alphabetical order
+ std::sort(table.begin(), table.end(), [](const ChatCommand& a, const ChatCommand&b)
+ {
+ return strcmp(a.Name, b.Name) < 0;
+ });
+
return table;
}