* Fixes for Linux build.
--HG-- branch : trunk
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -98,7 +98,7 @@ class ChatHandler
|
||||
void SendGlobalGMSysMessage(const char *str);
|
||||
|
||||
static bool SetDataForCommandInTable(ChatCommand *table, const char* text, uint32 security, std::string const& help, std::string const& fullcommand);
|
||||
bool ExecuteCommandInTables(std::vector<ChatCommand*>& tables, const char* text, const std::string& fullcmd);
|
||||
bool ExecuteCommandInTables(std::vector<ChatCommand*> const& tables, const char* text, const std::string& fullcmd);
|
||||
bool ExecuteCommandInTable(ChatCommand *table, const char* text, const std::string& fullcmd);
|
||||
bool ShowHelpForCommand(ChatCommand *table, const char* cmd);
|
||||
bool ShowHelpForSubCommands(ChatCommand *table, char const* cmd, char const* subcmd);
|
||||
|
||||
@@ -914,11 +914,11 @@ class ScriptMgr
|
||||
// Gets a script by its ID (assigned by ObjectMgr).
|
||||
static TScript* GetScriptById(uint32 id)
|
||||
{
|
||||
for (ScriptMap::iterator it = ScriptPointerList.begin(); it != ScriptPointerList.end(); ++it)
|
||||
if (it->first == id)
|
||||
return it->second;
|
||||
ScriptMap::iterator it = ScriptPointerList.find(id);
|
||||
if (it == ScriptPointerList.end())
|
||||
return NULL;
|
||||
|
||||
return NULL;
|
||||
return it->second;
|
||||
}
|
||||
|
||||
// Attempts to add a new script to the list.
|
||||
|
||||
Reference in New Issue
Block a user