aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Chat/Chat.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/game/Chat/Chat.cpp')
-rw-r--r--src/server/game/Chat/Chat.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/server/game/Chat/Chat.cpp b/src/server/game/Chat/Chat.cpp
index 26e07ab62c3..d3e153e3a89 100644
--- a/src/server/game/Chat/Chat.cpp
+++ b/src/server/game/Chat/Chat.cpp
@@ -959,9 +959,9 @@ void ChatHandler::PSendSysMessage(const char *format, ...)
SendSysMessage(str);
}
-bool ChatHandler::ExecuteCommandInTables(std::vector<ChatCommand*>& tables, const char* text, const std::string& fullcmd)
+bool ChatHandler::ExecuteCommandInTables(std::vector<ChatCommand*> const& tables, const char* text, const std::string& fullcmd)
{
- for (std::vector<ChatCommand*>::iterator it = tables.begin(); it != tables.end(); ++it)
+ for (std::vector<ChatCommand*>::const_iterator it = tables.begin(); it != tables.end(); ++it)
if (ExecuteCommandInTable((*it), text, fullcmd))
return true;
@@ -1125,7 +1125,8 @@ int ChatHandler::ParseCommands(const char* text)
if (!ExecuteCommandInTable(getCommandTable(), text, fullcmd))
{
- if (!ExecuteCommandInTables(sScriptMgr.GetChatCommands(), text, fullcmd))
+ std::vector<ChatCommand*> const& tables = sScriptMgr.GetChatCommands();
+ if (!ExecuteCommandInTables(tables, text, fullcmd))
{
if (m_session && m_session->GetSecurity() == SEC_PLAYER)
return 0;