Scripts/Commands: Fix ".help" command to show commands in alphabetical order

This commit is contained in:
jackpoz
2016-01-04 23:30:46 +01:00
parent f22b1938db
commit 841ce54a0d

View File

@@ -1042,6 +1042,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;
}