From d42204efb35421af7063c25f2af18ac36f1f4eaf Mon Sep 17 00:00:00 2001 From: hondacrx Date: Tue, 6 Feb 2024 15:58:28 -0500 Subject: [PATCH] Core/Battlegrounds: Added OnMapSet hook Port From (https://github.com/TrinityCore/TrinityCore/commit/141b881fa00dca87f7f262a1fb0d2d3e8b7735b5) --- Source/Game/BattleGrounds/BattleGround.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Source/Game/BattleGrounds/BattleGround.cs b/Source/Game/BattleGrounds/BattleGround.cs index a6c9db210..5fa34e7ac 100644 --- a/Source/Game/BattleGrounds/BattleGround.cs +++ b/Source/Game/BattleGrounds/BattleGround.cs @@ -1359,7 +1359,10 @@ namespace Game.BattleGrounds { m_Map = map; if (map != null) + { _pvpStatIds = Global.DB2Mgr.GetPVPStatIDsForMap(map.GetId()); + OnMapSet(map); + } else _pvpStatIds = null; } @@ -1793,6 +1796,9 @@ namespace Game.BattleGrounds return m_Players.LookupByKey(playerGuid); } + // Called when valid BattlegroundMap is assigned to the battleground + public virtual void OnMapSet(BattlegroundMap map) { } + public virtual void StartingEventCloseDoors() { } public virtual void StartingEventOpenDoors() { }