diff options
author | ShinDarth <borzifrancesco@gmail.com> | 2016-08-23 10:02:41 +0200 |
---|---|---|
committer | ShinDarth <borzifrancesco@gmail.com> | 2016-08-23 10:02:41 +0200 |
commit | edd5f4a19267b55fe015150d653969f46ecd50a4 (patch) | |
tree | fc5ebc92a4a8482877b148d8560f8f38b22ed3a5 /src | |
parent | b6d2c9b2260c74367a868d8ead2e57b425d97775 (diff) |
Core/Chat: fixed crash in commands
closes #110
Diffstat (limited to 'src')
-rw-r--r-- | src/game/Chat/Chat.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/game/Chat/Chat.cpp b/src/game/Chat/Chat.cpp index 432fa19c97..34946bc92e 100644 --- a/src/game/Chat/Chat.cpp +++ b/src/game/Chat/Chat.cpp @@ -136,7 +136,7 @@ bool ChatHandler::hasStringAbbr(const char* name, const char* part) if (!*part) return false; - for (;;) + while (true) { if (!*part) return true; @@ -246,7 +246,6 @@ bool ChatHandler::ExecuteCommandInTable(std::vector<ChatCommand> const& table, c for (uint32 i = 0; i < table.size(); ++i) { - // for data fill use full explicit command names if (table[i].Name == nullptr) continue; @@ -258,6 +257,9 @@ bool ChatHandler::ExecuteCommandInTable(std::vector<ChatCommand> const& table, c { for (uint32 j = 0; j < table.size(); ++j) { + if (table[j].Name == nullptr) + continue; + if (!hasStringAbbr(table[j].Name, cmd.c_str())) continue; @@ -268,7 +270,6 @@ bool ChatHandler::ExecuteCommandInTable(std::vector<ChatCommand> const& table, c } } } - if (match) continue; |