aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy <Golrag@users.noreply.github.com>2024-01-27 18:18:24 +0100
committerModoX <moardox@gmail.com>2024-01-27 18:18:24 +0100
commit141b881fa00dca87f7f262a1fb0d2d3e8b7735b5 (patch)
tree639ffacd5b34ea9a652776f109a4df329c7163ac
parentd03e0d69353852636e12911a7f7149cb0bca40ef (diff)
Core/Battlegrounds: Added OnMapSet hook
-rw-r--r--src/server/game/Battlegrounds/Battleground.cpp3
-rw-r--r--src/server/game/Battlegrounds/Battleground.h3
2 files changed, 6 insertions, 0 deletions
diff --git a/src/server/game/Battlegrounds/Battleground.cpp b/src/server/game/Battlegrounds/Battleground.cpp
index 67f47e2733d..9d123881401 100644
--- a/src/server/game/Battlegrounds/Battleground.cpp
+++ b/src/server/game/Battlegrounds/Battleground.cpp
@@ -1449,7 +1449,10 @@ void Battleground::SetBgMap(BattlegroundMap* map)
{
m_Map = map;
if (map)
+ {
_pvpStatIds = sDB2Manager.GetPVPStatIDsForMap(map->GetId());
+ OnMapSet(map);
+ }
else
_pvpStatIds = nullptr;
}
diff --git a/src/server/game/Battlegrounds/Battleground.h b/src/server/game/Battlegrounds/Battleground.h
index 843f1c57f1d..a3e0ca3ee32 100644
--- a/src/server/game/Battlegrounds/Battleground.h
+++ b/src/server/game/Battlegrounds/Battleground.h
@@ -494,6 +494,9 @@ class TC_GAME_API Battleground : public ZoneScript
return &itr->second;
}
+ // Called when valid BattlegroundMap is assigned to the battleground
+ virtual void OnMapSet([[maybe_unused]] BattlegroundMap* map) { }
+
protected:
// this method is called, when BG cannot spawn its own spirit guide, or something is wrong, It correctly ends Battleground
void EndNow();