feat: expose OnPlayerUpdateArea() (#65)

This commit is contained in:
55Honey
2022-10-01 08:45:49 +02:00
committed by GitHub
parent ecc8d3136d
commit 655953ebfb
4 changed files with 16 additions and 0 deletions

View File

@@ -722,6 +722,11 @@ public:
sEluna->OnBindToInstance(player, difficulty, mapid, permanent);
}
void OnUpdateArea(Player* player, uint32 oldArea, uint32 newArea) override
{
sEluna->OnUpdateArea(player, oldArea, newArea);
}
void OnUpdateZone(Player* player, uint32 newZone, uint32 newArea) override
{
sEluna->OnUpdateZone(player, newZone, newArea);

View File

@@ -208,6 +208,7 @@ namespace Hooks
PLAYER_EVENT_ON_LEARN_SPELL = 44, // (event, player, spellId)
PLAYER_EVENT_ON_ACHIEVEMENT_COMPLETE = 45, // (event, player, achievement)
PLAYER_EVENT_ON_FFAPVP_CHANGE = 46, // (event, player, hasFfaPvp)
PLAYER_EVENT_ON_UPDATE_AREA = 47, // (event, player, oldArea, newArea)
PLAYER_EVENT_COUNT
};

View File

@@ -469,6 +469,7 @@ public:
void OnDelete(uint32 guid);
void OnSave(Player* pPlayer);
void OnBindToInstance(Player* pPlayer, Difficulty difficulty, uint32 mapid, bool permanent);
void OnUpdateArea(Player* pPlayer, uint32 oldArea, uint32 newArea);
void OnUpdateZone(Player* pPlayer, uint32 newZone, uint32 newArea);
void OnMapChanged(Player* pPlayer);
void HandleGossipSelectOption(Player* pPlayer, uint32 menuId, uint32 sender, uint32 action, const std::string& code);

View File

@@ -381,6 +381,15 @@ void Eluna::OnBindToInstance(Player* pPlayer, Difficulty difficulty, uint32 mapi
CallAllFunctions(PlayerEventBindings, key);
}
void Eluna::OnUpdateArea(Player* pPlayer, uint32 oldArea, uint32 newArea)
{
START_HOOK(PLAYER_EVENT_ON_UPDATE_AREA);
Push(pPlayer);
Push(oldArea);
Push(newArea);
CallAllFunctions(PlayerEventBindings, key);
}
void Eluna::OnUpdateZone(Player* pPlayer, uint32 newZone, uint32 newArea)
{
START_HOOK(PLAYER_EVENT_ON_UPDATE_ZONE);