SAI/GameObject: Despawn the linked trap with the gameobject

Port From (https://github.com/TrinityCore/TrinityCore/commit/8d806f8c6943b54533dbf9a69febee3df1d00430)
This commit is contained in:
hondacrx
2021-11-29 14:46:00 -05:00
parent a557dbea68
commit f91bb7e9fe
@@ -919,6 +919,11 @@ namespace Game.Entities
public void Delete()
{
// If nearby linked trap exists, despawn it
GameObject linkedTrap = GetLinkedTrap();
if (linkedTrap != null)
linkedTrap.DespawnOrUnsummon();
SetLootState(LootState.NotReady);
RemoveFromOwner();