Core/Battlegrounds: Added OnMapSet hook

This commit is contained in:
Jeremy
2024-01-27 18:18:24 +01:00
committed by ModoX
parent d03e0d6935
commit 141b881fa0
2 changed files with 6 additions and 0 deletions

View File

@@ -1449,7 +1449,10 @@ void Battleground::SetBgMap(BattlegroundMap* map)
{
m_Map = map;
if (map)
{
_pvpStatIds = sDB2Manager.GetPVPStatIDsForMap(map->GetId());
OnMapSet(map);
}
else
_pvpStatIds = nullptr;
}

View File

@@ -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();