Scripts: PlayerScript::OnPingUnit and OnPingWorldPoint, called after a group ping is relayed (#59)
Why: a script can not see the pings a player sends to the group. Pings are the one way a player points at a target or a spot without chat, so a module that reacts to a player's orders (for example an "attack this" or "come here" ping) has no way to get them. What: two virtual PlayerScript hooks, empty by default, and one ScriptMgr call each at the end of HandleSendPingUnit and HandleSendPingWorldPoint, after the packet went to the group. Nothing changes for the packets or for any script that does not override them.
This commit is contained in:
@@ -2132,6 +2132,16 @@ void ScriptMgr::OnPlayerAddonMessageSent(Player* player, uint32 type, std::strin
|
||||
FOREACH_SCRIPT(PlayerScript)->OnAddonMessageSent(player, type, prefix, text, group);
|
||||
}
|
||||
|
||||
void ScriptMgr::OnPlayerPingUnit(Player* player, Group* group, Unit* target, uint8 type)
|
||||
{
|
||||
FOREACH_SCRIPT(PlayerScript)->OnPingUnit(player, group, target, type);
|
||||
}
|
||||
|
||||
void ScriptMgr::OnPlayerPingWorldPoint(Player* player, Group* group, Position const& point, uint8 type)
|
||||
{
|
||||
FOREACH_SCRIPT(PlayerScript)->OnPingWorldPoint(player, group, point, type);
|
||||
}
|
||||
|
||||
void ScriptMgr::OnPlayerClearEmote(Player* player)
|
||||
{
|
||||
FOREACH_SCRIPT(PlayerScript)->OnClearEmote(player);
|
||||
@@ -3098,6 +3108,14 @@ void PlayerScript::OnAddonMessageSent(Player* /*player*/, uint32 /*type*/, std::
|
||||
{
|
||||
}
|
||||
|
||||
void PlayerScript::OnPingUnit(Player* /*player*/, Group* /*group*/, Unit* /*target*/, uint8 /*type*/)
|
||||
{
|
||||
}
|
||||
|
||||
void PlayerScript::OnPingWorldPoint(Player* /*player*/, Group* /*group*/, Position const& /*point*/, uint8 /*type*/)
|
||||
{
|
||||
}
|
||||
|
||||
void PlayerScript::OnClearEmote(Player* /*player*/)
|
||||
{
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user