From 63be1f8dd59f329a3b252bf34b5f649fd7d44c8d Mon Sep 17 00:00:00 2001 From: hondacrx Date: Fri, 25 Feb 2022 14:19:54 -0500 Subject: [PATCH] Core/Units: Fixed crash happening when despawning summoned units whose owner is no longer in world Port From (https://github.com/TrinityCore/TrinityCore/commit/5889ab893e8252ef46ea00527f5e91bf97371182) --- Source/Game/Entities/Unit/Unit.Pets.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Source/Game/Entities/Unit/Unit.Pets.cs b/Source/Game/Entities/Unit/Unit.Pets.cs index 76eb66210..9393c1ebb 100644 --- a/Source/Game/Entities/Unit/Unit.Pets.cs +++ b/Source/Game/Entities/Unit/Unit.Pets.cs @@ -182,7 +182,7 @@ namespace Game.Entities minion.SetSpeedRate(i, m_speed_rate[(int)i]); // Send infinity cooldown - client does that automatically but after relog cooldown needs to be set again - SpellInfo spellInfo = Global.SpellMgr.GetSpellInfo(minion.m_unitData.CreatedBySpell, GetMap().GetDifficultyID()); + SpellInfo spellInfo = Global.SpellMgr.GetSpellInfo(minion.m_unitData.CreatedBySpell, Difficulty.None); if (spellInfo != null && spellInfo.IsCooldownStartedOnEvent()) GetSpellHistory().StartCooldown(spellInfo, 0, null, true); } @@ -210,7 +210,7 @@ namespace Game.Entities else if (minion.IsTotem()) { // All summoned by totem minions must disappear when it is removed. - SpellInfo spInfo = Global.SpellMgr.GetSpellInfo(minion.ToTotem().GetSpell(), GetMap().GetDifficultyID()); + SpellInfo spInfo = Global.SpellMgr.GetSpellInfo(minion.ToTotem().GetSpell(), Difficulty.None); if (spInfo != null) { foreach (var spellEffectInfo in spInfo.GetEffects()) @@ -223,7 +223,7 @@ namespace Game.Entities } } - SpellInfo spellInfo = Global.SpellMgr.GetSpellInfo(minion.m_unitData.CreatedBySpell, GetMap().GetDifficultyID()); + SpellInfo spellInfo = Global.SpellMgr.GetSpellInfo(minion.m_unitData.CreatedBySpell, Difficulty.None); // Remove infinity cooldown if (spellInfo != null && spellInfo.IsCooldownStartedOnEvent()) GetSpellHistory().SendCooldownEvent(spellInfo);