Core/GameObject: Fix battleground flags not showing burning animation

Port From (https://github.com/TrinityCore/TrinityCore/commit/7d63166ff3e819e3043f155b3df4007cccb81dee)
This commit is contained in:
hondacrx
2022-01-05 17:20:44 -05:00
parent 4b255ad8ea
commit 95c3782ccb
+15 -4
View File
@@ -1447,11 +1447,22 @@ 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.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);