mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-18 08:28:32 +01:00
Core/GameObjects: Fix infinite respawning of chest gameobjects that are summoned trough spells with ie. SPELL_EFFECT_SUMMON_OBJECT_WILD
Closes #1618 Closes #2486
This commit is contained in:
@@ -545,14 +545,12 @@ void GameObject::Update(uint32 diff)
|
||||
|
||||
loot.clear();
|
||||
|
||||
if (GetOwnerGUID())
|
||||
//! If this is summoned by a spell with ie. SPELL_EFFECT_SUMMON_OBJECT_WILD, with or without owner, we check respawn criteria based on spell
|
||||
//! The GetOwnerGUID() check is mostly for compatibility with hacky scripts - 99% of the time summoning should be done trough spells.
|
||||
if (GetSpellId() || GetOwnerGUID())
|
||||
{
|
||||
if (Unit* owner = GetOwner())
|
||||
{
|
||||
owner->RemoveGameObject(this, false);
|
||||
SetRespawnTime(0);
|
||||
Delete();
|
||||
}
|
||||
SetRespawnTime(0);
|
||||
Delete();
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user