Core/Battlegrounds: Replace manual criteria timer starts in battlegrounds with new GameEvents api

Port From (https://github.com/TrinityCore/TrinityCore/commit/111fc6ac6fd703bb645046e7a477a986d8519a64)
This commit is contained in:
hondacrx
2022-05-31 19:51:16 -04:00
parent 623c3198c0
commit adfca19d4c
6 changed files with 32 additions and 20 deletions
+3 -2
View File
@@ -1846,13 +1846,14 @@ namespace Game.BattleGrounds
return Global.ObjectMgr.GetClosestGraveYard(player, GetPlayerTeam(player.GetGUID()), player);
}
public void StartCriteriaTimer(CriteriaStartEvent startEvent, uint entry)
public void TriggerGameEvent(uint gameEventId)
{
GameEvents.TriggerForMap(gameEventId, GetBgMap());
foreach (var guid in GetPlayers().Keys)
{
Player player = Global.ObjAccessor.FindPlayer(guid);
if (player)
player.StartCriteriaTimer(startEvent, entry);
GameEvents.TriggerForPlayer(gameEventId, player);
}
}