Core/Commands: Refactored chat command script hook, fixes a crash when building with gcc 5

Closes #15616
Closes #15740
This commit is contained in:
Shauren
2015-10-22 20:26:56 +02:00
parent 935c93e099
commit 2d942ddcc5
46 changed files with 776 additions and 1025 deletions

View File

@@ -33,6 +33,7 @@
#include "Player.h"
#include "WorldPacket.h"
#include "WorldSession.h"
#include "Chat.h"
// namespace
// {
@@ -975,12 +976,15 @@ OutdoorPvP* ScriptMgr::CreateOutdoorPvP(OutdoorPvPData const* data)
return tmpscript->GetOutdoorPvP();
}
std::vector<ChatCommand*> ScriptMgr::GetChatCommands()
std::vector<ChatCommand> ScriptMgr::GetChatCommands()
{
std::vector<ChatCommand*> table;
std::vector<ChatCommand> table;
FOR_SCRIPTS_RET(CommandScript, itr, end, table)
table.push_back(itr->second->GetCommands());
{
std::vector<ChatCommand> cmds = itr->second->GetCommands();
table.insert(table.end(), cmds.begin(), cmds.end());
}
return table;
}