mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-02-02 15:17:27 +01:00
Core/Scripting: Created a hook for when a player is about to be saved.
This commit is contained in:
@@ -1241,6 +1241,11 @@ void ScriptMgr::OnPlayerDelete(uint64 guid)
|
||||
FOREACH_SCRIPT(PlayerScript)->OnDelete(guid);
|
||||
}
|
||||
|
||||
void ScriptMgr::OnPlayerSave(Player* player)
|
||||
{
|
||||
FOREACH_SCRIPT(PlayerScript)->OnSave(player);
|
||||
}
|
||||
|
||||
void ScriptMgr::OnPlayerBindToInstance(Player* player, Difficulty difficulty, uint32 mapid, bool permanent)
|
||||
{
|
||||
FOREACH_SCRIPT(PlayerScript)->OnBindToInstance(player, difficulty, mapid, permanent);
|
||||
|
||||
@@ -746,6 +746,9 @@ class PlayerScript : public UnitScript
|
||||
// Called when a player is deleted.
|
||||
virtual void OnDelete(uint64 /*guid*/) { }
|
||||
|
||||
// Called whe is a player is about to be saved.
|
||||
virtual void OnSave(Player* /*player*/) { }
|
||||
|
||||
// Called when a player is bound to an instance
|
||||
virtual void OnBindToInstance(Player* /*player*/, Difficulty /*difficulty*/, uint32 /*mapId*/, bool /*permanent*/) { }
|
||||
|
||||
@@ -1022,6 +1025,7 @@ class ScriptMgr
|
||||
void OnPlayerLogout(Player* player);
|
||||
void OnPlayerCreate(Player* player);
|
||||
void OnPlayerDelete(uint64 guid);
|
||||
void OnPlayerSave(Player* player);
|
||||
void OnPlayerBindToInstance(Player* player, Difficulty difficulty, uint32 mapid, bool permanent);
|
||||
void OnPlayerUpdateZone(Player* player, uint32 newZone, uint32 newArea);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user