Core/Loot/Gameobject: Tempspawned Gameobjects after looting

Port From (https://github.com/TrinityCore/TrinityCore/commit/8c9e5cd3f3200b378ff09a6822ceb2b5bd223e3c)
This commit is contained in:
hondacrx
2021-10-30 20:10:17 -04:00
parent 1578935f08
commit e86e640c5a
+11 -2
View File
@@ -802,8 +802,17 @@ namespace Game.Entities
//! The GetOwnerGUID() check is mostly for compatibility with hacky scripts - 99% of the time summoning should be done trough spells.
if (GetSpellId() != 0 || !GetOwnerGUID().IsEmpty())
{
SetRespawnTime(0);
Delete();
//Don't delete spell spawned chests, which are not consumed on loot
if (m_respawnTime > 0 && GetGoType() == GameObjectTypes.Chest && !GetGoInfo().IsDespawnAtAction())
{
UpdateObjectVisibility();
SetLootState(LootState.Ready);
}
else
{
SetRespawnTime(0);
Delete();
}
return;
}