diff options
| author | ShinDarth <borzifrancesco@gmail.com> | 2016-08-24 01:14:28 +0200 |
|---|---|---|
| committer | ShinDarth <borzifrancesco@gmail.com> | 2016-08-24 01:14:28 +0200 |
| commit | d538b86a4710ab056556e6ea144e4ed38b9ec6c2 (patch) | |
| tree | 88444e38f121add1a5c44edd92ddeb697dc42a24 /src/game/Scripting/ScriptMgr.cpp | |
| parent | 17061cbbb481122317a8a54aef508f3eca475a0b (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.cpp | 6 |
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; } |
