Core/ScriptSystem: Refactor ScriptMgr::OnPlayerChat to no longer accept a C-style parameter of type void*.

Instead, use overloaded methods for the different types.

--HG--
branch : trunk
This commit is contained in:
silinoron
2010-09-04 12:49:39 -07:00
parent 0f9fe8dbeb
commit 0f997162ee
3 changed files with 112 additions and 87 deletions

View File

@@ -1117,9 +1117,29 @@ void ScriptMgr::OnPlayerReputationChange(Player *player, uint32 factionID, int32
FOREACH_SCRIPT(PlayerScript)->OnReputationChange(player, factionID, standing, incremental);
}
void ScriptMgr::OnPlayerChat(Player* player, uint32 type, uint32 lang, std::string msg, void* param)
void ScriptMgr::OnPlayerChat(Player* player, uint32 type, uint32 lang, std::string msg)
{
FOREACH_SCRIPT(PlayerScript)->OnChat(player, type, lang, msg, param);
FOREACH_SCRIPT(PlayerScript)->OnChat(player, type, lang, msg);
}
void ScriptMgr::OnPlayerChat(Player* player, uint32 type, uint32 lang, std::string msg, Player* receiver)
{
FOREACH_SCRIPT(PlayerScript)->OnChat(player, type, lang, msg, receiver);
}
void ScriptMgr::OnPlayerChat(Player* player, uint32 type, uint32 lang, std::string msg, Group* group)
{
FOREACH_SCRIPT(PlayerScript)->OnChat(player, type, lang, msg, group);
}
void ScriptMgr::OnPlayerChat(Player* player, uint32 type, uint32 lang, std::string msg, Guild* guild)
{
FOREACH_SCRIPT(PlayerScript)->OnChat(player, type, lang, msg, guild);
}
void ScriptMgr::OnPlayerChat(Player* player, uint32 type, uint32 lang, std::string msg, Channel* channel)
{
FOREACH_SCRIPT(PlayerScript)->OnChat(player, type, lang, msg, channel);
}
void ScriptMgr::OnPlayerEmote(Player* player, uint32 emote)