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 e24f37b885a..d65f02a404c 100644
--- a/src/server/game/Entities/GameObject/GameObject.cpp
+++ b/src/server/game/Entities/GameObject/GameObject.cpp
@@ -755,8 +755,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())
{
- 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;
}