mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-19 17:05:44 +01:00
Core/GameObject: Remove linked traps when the main GameObject is remo… (#24480)
* Core/GameObject: Remove linked traps when the main GameObject is removed from from the world * Indentation
This commit is contained in:
@@ -248,6 +248,10 @@ void GameObject::RemoveFromWorld()
|
||||
if (GetMap()->ContainsGameObjectModel(*m_model))
|
||||
GetMap()->RemoveGameObjectModel(*m_model);
|
||||
|
||||
// If linked trap exists, despawn it
|
||||
if (GameObject* linkedTrap = GetLinkedTrap())
|
||||
linkedTrap->DespawnOrUnsummon();
|
||||
|
||||
WorldObject::RemoveFromWorld();
|
||||
|
||||
if (m_spawnId)
|
||||
@@ -848,10 +852,6 @@ void GameObject::DespawnOrUnsummon(Milliseconds const& delay, Seconds const& for
|
||||
|
||||
void GameObject::Delete()
|
||||
{
|
||||
// If nearby linked trap exists, despawn it
|
||||
if (GameObject* linkedTrap = GetLinkedTrap())
|
||||
linkedTrap->DespawnOrUnsummon();
|
||||
|
||||
SetLootState(GO_NOT_READY);
|
||||
RemoveFromOwner();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user