diff options
author | maximius <none@none> | 2009-08-15 19:18:30 -0700 |
---|---|---|
committer | maximius <none@none> | 2009-08-15 19:18:30 -0700 |
commit | f2a22871a2d33b8416a7c9a21a3e9f1d844ced02 (patch) | |
tree | ae0e4ee4a80a811f7f63b5cf781d81ab20ab93be | |
parent | 53bc13fad8b7ad0caed27bf545365765b2f68f76 (diff) |
*More cleanup :)
--HG--
branch : trunk
-rw-r--r-- | src/trinitycore/CliRunnable.cpp | 31 |
1 files changed, 15 insertions, 16 deletions
diff --git a/src/trinitycore/CliRunnable.cpp b/src/trinitycore/CliRunnable.cpp index ab006e3d046..966b0b4dabb 100644 --- a/src/trinitycore/CliRunnable.cpp +++ b/src/trinitycore/CliRunnable.cpp @@ -49,29 +49,28 @@ char * command_finder(const char* text, int state) ChatCommand *cmd = ChatHandler::getCommandTable(); if(!state) - { - idx = 0; - len = strlen(text); - } + { + idx = 0; + len = strlen(text); + } while(ret = cmd[idx].Name) + { + if(!cmd[idx].AllowConsole) { - if(!cmd[idx].AllowConsole) - { - idx++; - continue; - } - idx++; - //printf("Checking %s \n", cmd[idx].Name); - if (strncmp(ret, text, len) == 0) - return strdup(ret); - if(cmd[idx].Name == NULL) - break; + continue; } - return ((char*)NULL); + idx++; + //printf("Checking %s \n", cmd[idx].Name); + if (strncmp(ret, text, len) == 0) + return strdup(ret); + if(cmd[idx].Name == NULL) + break; + } + return ((char*)NULL); } char ** cli_completion(const char * text, int start, int end) |