aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/server/game/Entities/GameObject/GameObject.cpp13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/server/game/Entities/GameObject/GameObject.cpp b/src/server/game/Entities/GameObject/GameObject.cpp
index 8b7b9ed6eb7..01c817a6d60 100644
--- a/src/server/game/Entities/GameObject/GameObject.cpp
+++ b/src/server/game/Entities/GameObject/GameObject.cpp
@@ -885,8 +885,17 @@ void GameObject::Update(uint32 diff)
//! The GetOwnerGUID() check is mostly for compatibility with hacky scripts - 99% of the time summoning should be done trough spells.
if (GetSpellId() || !GetOwnerGUID().IsEmpty())
{
- SetRespawnTime(0);
- Delete();
+ //Don't delete spell spawned chests, which are not consumed on loot
+ if (m_respawnTime > 0 && GetGoType() == GAMEOBJECT_TYPE_CHEST && !GetGOInfo()->IsDespawnAtAction())
+ {
+ UpdateObjectVisibility();
+ SetLootState(GO_READY);
+ }
+ else
+ {
+ SetRespawnTime(0);
+ Delete();
+ }
return;
}