mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-19 17:05:44 +01:00
Core/Battlegrounds: Added OnMapSet hook
This commit is contained in:
@@ -1449,7 +1449,10 @@ void Battleground::SetBgMap(BattlegroundMap* map)
|
||||
{
|
||||
m_Map = map;
|
||||
if (map)
|
||||
{
|
||||
_pvpStatIds = sDB2Manager.GetPVPStatIDsForMap(map->GetId());
|
||||
OnMapSet(map);
|
||||
}
|
||||
else
|
||||
_pvpStatIds = nullptr;
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user