diff options
author | Yehonal <yehonal.azeroth@gmail.com> | 2016-08-20 09:49:37 +0200 |
---|---|---|
committer | Yehonal <yehonal.azeroth@gmail.com> | 2016-08-20 09:49:37 +0200 |
commit | 1b1767e9f4c20d1e20541968de98d00814f63247 (patch) | |
tree | ee95040cf29644aff151f9aebdf3bfd9e18ae08d /src/game | |
parent | d7fdf7c940317aebcbbeeaf156469e1571e01498 (diff) |
Fix commands and starting to use nullptr instead of NULL
Diffstat (limited to 'src/game')
-rw-r--r-- | src/game/Chat/Chat.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/game/Chat/Chat.cpp b/src/game/Chat/Chat.cpp index 963d95d3d9..220e9685f7 100644 --- a/src/game/Chat/Chat.cpp +++ b/src/game/Chat/Chat.cpp @@ -348,10 +348,10 @@ bool ChatHandler::SetDataForCommandInTable(std::vector<ChatCommand>& table, char while (*text == ' ') ++text; - for (uint32 i = 0; table[i].Name != nullptr; i++) + for (uint32 i = 0; i < table.size(); i++) { // for data fill use full explicit command names - if (table[i].Name != cmd) + if (table[i].Name == nullptr || table[i].Name != cmd) continue; // select subcommand from child commands list (including "") @@ -372,7 +372,7 @@ bool ChatHandler::SetDataForCommandInTable(std::vector<ChatCommand>& table, char } //if (table[i].SecurityLevel != security) - ;//sLog->outDetail("Table `command` overwrite for command '%s' default security (%u) by %u", fullcommand.c_str(), table[i].SecurityLevel, security); + // sLog->outDetail("Table `command` overwrite for command '%s' default security (%u) by %u", fullcommand.c_str(), table[i].SecurityLevel, security); table[i].SecurityLevel = security; table[i].Help = help; @@ -383,9 +383,9 @@ bool ChatHandler::SetDataForCommandInTable(std::vector<ChatCommand>& table, char if (!cmd.empty()) { if (&table == &getCommandTable()) - sLog->outError("Table `command` have not existed command '%s', skip.", cmd.c_str()); + sLog->outError("Table `command` have non-existing command '%s', skip.", cmd.c_str()); else - sLog->outError("Table `command` have not existed subcommand '%s' in command '%s', skip.", cmd.c_str(), fullcommand.c_str()); + sLog->outError("Table `command` have non-existing subcommand '%s' in command '%s', skip.", cmd.c_str(), fullcommand.c_str()); } return false; |