Core/Chat: properly prevent crashes + cleaning (import from TrinityCore)

- Closes #111
This commit is contained in:
ShinDarth
2016-08-24 01:14:28 +02:00
parent 17061cbbb4
commit d538b86a47
5 changed files with 16 additions and 11 deletions

View File

@@ -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;
}