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

View File

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