* Fixes for Linux build.

--HG--
branch : trunk
This commit is contained in:
XTZGZoReX
2010-08-06 23:21:58 +02:00
parent f413d60908
commit 0993b1fcb5
3 changed files with 9 additions and 8 deletions
+4 -3
View File
@@ -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;
+1 -1
View File
@@ -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);
+4 -4
View File
@@ -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 it->second;
}
// Attempts to add a new script to the list.