mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-14 01:29:07 +00:00
fix(Core/Gameobject): Spell spawned chests should not despawn on loot (#4413)
* Fix despawning temporary lootable objects * Fix codestyle * Add comment * Fix indendation Co-authored-by: Zoidwaffle <zoidwaffle@gmail.com>
This commit is contained in:
@@ -707,8 +707,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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user