Core/Chat: fixed crash in commands

closes #110
This commit is contained in:
ShinDarth
2016-08-23 10:02:41 +02:00
parent b6d2c9b226
commit edd5f4a192
+4 -3
View File
@@ -136,7 +136,7 @@ bool ChatHandler::hasStringAbbr(const char* name, const char* part)
if (!*part) if (!*part)
return false; return false;
for (;;) while (true)
{ {
if (!*part) if (!*part)
return true; return true;
@@ -246,7 +246,6 @@ bool ChatHandler::ExecuteCommandInTable(std::vector<ChatCommand> const& table, c
for (uint32 i = 0; i < table.size(); ++i) for (uint32 i = 0; i < table.size(); ++i)
{ {
// for data fill use full explicit command names
if (table[i].Name == nullptr) if (table[i].Name == nullptr)
continue; continue;
@@ -258,6 +257,9 @@ bool ChatHandler::ExecuteCommandInTable(std::vector<ChatCommand> const& table, c
{ {
for (uint32 j = 0; j < table.size(); ++j) for (uint32 j = 0; j < table.size(); ++j)
{ {
if (table[j].Name == nullptr)
continue;
if (!hasStringAbbr(table[j].Name, cmd.c_str())) if (!hasStringAbbr(table[j].Name, cmd.c_str()))
continue; continue;
@@ -268,7 +270,6 @@ bool ChatHandler::ExecuteCommandInTable(std::vector<ChatCommand> const& table, c
} }
} }
} }
if (match) if (match)
continue; continue;