SAI/GameObject: Despawn the linked trap with the gameobject

Closes #23105
This commit is contained in:
Killyana
2019-03-09 21:11:21 +01:00
parent dff66b9daa
commit 750be73b99

View File

@@ -879,6 +879,10 @@ void GameObject::DespawnOrUnsummon(Milliseconds delay, Seconds forceRespawnTime)
void GameObject::Delete()
{
// If nearby linked trap exists, despawn it
if (GameObject* linkedTrap = GetLinkedTrap())
linkedTrap->DespawnOrUnsummon();
SetLootState(GO_NOT_READY);
RemoveFromOwner();