From 5c4a42317e3c0599d5b60755cf156c8c767e1f9c Mon Sep 17 00:00:00 2001 From: hondacrx Date: Fri, 24 Dec 2021 21:20:14 -0500 Subject: [PATCH] Core/GameObject: fix some cases where summoned gameobjects of a type different than chest or goober would behave wrongly. Port From (https://github.com/TrinityCore/TrinityCore/commit/f136d3cfe0e92ac8578c631cc7c2c43086ba796f) --- Source/Game/Entities/GameObject/GameObject.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Source/Game/Entities/GameObject/GameObject.cs b/Source/Game/Entities/GameObject/GameObject.cs index 9fa36786a..25ffa1d24 100644 --- a/Source/Game/Entities/GameObject/GameObject.cs +++ b/Source/Game/Entities/GameObject/GameObject.cs @@ -815,9 +815,9 @@ namespace Game.Entities loot.Clear(); - // Do not delete gameobjects that are not consumed on loot, while still allowing them to despawn when they expire if summoned + // Do not delete chests or goobers that are not consumed on loot, while still allowing them to despawn when they expire if summoned bool isSummonedAndExpired = (GetOwner() != null || GetSpellId() != 0) && m_respawnTime == 0; - if (!GetGoInfo().IsDespawnAtAction() && !isSummonedAndExpired) + if ((GetGoType() == GameObjectTypes.Chest || GetGoType() == GameObjectTypes.Goober) && !GetGoInfo().IsDespawnAtAction() && !isSummonedAndExpired) { if (GetGoType() == GameObjectTypes.Chest && GetGoInfo().Chest.chestRestockTime > 0) { @@ -831,10 +831,11 @@ namespace Game.Entities UpdateObjectVisibility(); return; } - else if (GetOwner() != null || GetSpellId() != 0) + else if (!GetOwnerGUID().IsEmpty() || GetSpellId() != 0) { SetRespawnTime(0); Delete(); + return; } SetLootState(LootState.NotReady);