From 95c3782ccbf662f926811036e084bf630e03e601 Mon Sep 17 00:00:00 2001 From: hondacrx Date: Wed, 5 Jan 2022 17:20:44 -0500 Subject: [PATCH] Core/GameObject: Fix battleground flags not showing burning animation Port From (https://github.com/TrinityCore/TrinityCore/commit/7d63166ff3e819e3043f155b3df4007cccb81dee) --- Source/Game/BattleGrounds/BattleGround.cs | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/Source/Game/BattleGrounds/BattleGround.cs b/Source/Game/BattleGrounds/BattleGround.cs index cf2b517ae..17baba2ac 100644 --- a/Source/Game/BattleGrounds/BattleGround.cs +++ b/Source/Game/BattleGrounds/BattleGround.cs @@ -1437,7 +1437,7 @@ namespace Game.BattleGrounds { return (uint)_battlegroundTemplate.BattlemasterEntry.MapId[0]; } - + public void SpawnBGObject(int type, uint respawntime) { Map map = FindBgMap(); @@ -1447,12 +1447,23 @@ namespace Game.BattleGrounds if (obj) { if (respawntime != 0) - obj.SetLootState(LootState.JustDeactivated); - else { - if (obj.GetLootState() == LootState.JustDeactivated) - // Change state from GO_JUST_DEACTIVATED to GO_READY in case Battleground is starting again - obj.SetLootState(LootState.Ready); + obj.SetLootState(LootState.JustDeactivated); + { + GameObjectOverride goOverride = obj.GetGameObjectOverride(); + if (goOverride != null) + if (goOverride.Flags.HasFlag(GameObjectFlags.NoDespawn)) + { + // This function should be called in GameObject::Update() but in case of + // GO_FLAG_NODESPAWN flag the function is never called, so we call it here + obj.SendGameObjectDespawn(); + } + } + } + else if (obj.GetLootState() == LootState.JustDeactivated) + { + // Change state from GO_JUST_DEACTIVATED to GO_READY in case battleground is starting again + obj.SetLootState(LootState.Ready); } obj.SetRespawnTime((int)respawntime); map.AddToMap(obj);