diff options
author | PolarCookie <sei009@post.uit.no> | 2018-08-22 16:39:59 +0200 |
---|---|---|
committer | Shauren <shauren.trinity@gmail.com> | 2021-10-22 21:39:28 +0200 |
commit | 8c9e5cd3f3200b378ff09a6822ceb2b5bd223e3c (patch) | |
tree | 96017ba021c34c0baaec8daf40c7aa95967e2630 /src | |
parent | 1195e2cf1a8521f5ad2e2fa8f51ee98b3da8bb88 (diff) |
[3.3.5] Core/Loot/Gameobject: Tempspawned Gameobjects after looting (#22124)
* spell spawned chest non-despawn fix
* fix the consumed game objects
(cherry picked from commit 97371533bf4fa0664957b2badf2c945b5b7595c2)
Diffstat (limited to 'src')
-rw-r--r-- | src/server/game/Entities/GameObject/GameObject.cpp | 13 |
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; } |