diff --git a/src/game/Chat.cpp b/src/game/Chat.cpp index cb3e47969..724aff52f 100644 --- a/src/game/Chat.cpp +++ b/src/game/Chat.cpp @@ -725,7 +725,7 @@ ChatCommand * ChatHandler::getCommandTable() load_command_table = false; // check hardcoded part integrity - CheckIntergrity(commandTable, NULL); + CheckIntegrity(commandTable, NULL); QueryResult *result = WorldDatabase.Query("SELECT name,security,help FROM command"); if (result) @@ -897,7 +897,7 @@ void ChatHandler::PSendSysMessage(const char *format, ...) SendSysMessage(str); } -void ChatHandler::CheckIntergrity( ChatCommand *table, ChatCommand *parentCommand ) +void ChatHandler::CheckIntegrity( ChatCommand *table, ChatCommand *parentCommand ) { for(uint32 i = 0; table[i].Name != NULL; ++i) { @@ -912,10 +912,29 @@ void ChatHandler::CheckIntergrity( ChatCommand *table, ChatCommand *parentComman if (command->ChildCommands) { + if (command->Handler) + { + if (parentCommand) + sLog.outError("Subcommand '%s' of command '%s' have handler and subcommands in same time, must be used '' subcommand for handler instead.", + command->Name, parentCommand->Name); + else + sLog.outError("First level command '%s' have handler and subcommands in same time, must be used '' subcommand for handler instead.", + command->Name); + } + if (parentCommand && strlen(command->Name)==0) sLog.outError("Subcommand '' of command '%s' have subcommands", parentCommand->Name); - CheckIntergrity(command->ChildCommands, command); + CheckIntegrity(command->ChildCommands, command); + } + else if (!command->Handler) + { + if (parentCommand) + sLog.outError("Subcommand '%s' of command '%s' not have handler and subcommands in same time. Must have some from its!", + command->Name, parentCommand->Name); + else + sLog.outError("First level command '%s' not have handler and subcommands in same time. Must have some from its!", + command->Name); } } } diff --git a/src/game/Chat.h b/src/game/Chat.h index 455c1f607..5cf2b99eb 100644 --- a/src/game/Chat.h +++ b/src/game/Chat.h @@ -105,7 +105,7 @@ class ChatHandler bool ShowHelpForSubCommands(ChatCommand *table, char const* cmd); ChatCommandSearchResult FindCommand(ChatCommand* table, char const*& text, ChatCommand*& command, ChatCommand** parentCommand = NULL, std::string* cmdNamePtr = NULL, bool allAvailable = false); - void CheckIntergrity(ChatCommand *table, ChatCommand *parentCommand); + void CheckIntegrity(ChatCommand *table, ChatCommand *parentCommand); ChatCommand* getCommandTable(); bool HandleAccountCommand(const char* args); diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index 6e10f5d74..e6fe223fb 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "10281" + #define REVISION_NR "10282" #endif // __REVISION_NR_H__