diff options
author | Shauren <shauren.trinity@gmail.com> | 2022-01-12 12:50:17 +0100 |
---|---|---|
committer | Shauren <shauren.trinity@gmail.com> | 2022-01-12 12:50:17 +0100 |
commit | 5889ab893e8252ef46ea00527f5e91bf97371182 (patch) | |
tree | 8236895bcfe5859ce138fe33fbf40293729fa4d7 /src | |
parent | bd19e225137377a0d6925960b715f58ea18652bc (diff) |
Core/Units: Fixed crash happening when despawning summoned units whose owner is no longer in world
Closes #27598
Diffstat (limited to 'src')
-rw-r--r-- | src/server/game/Entities/Unit/Unit.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 20fb86d4c05..cde6892fd1b 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -5883,7 +5883,7 @@ void Unit::SetMinion(Minion *minion, bool apply) minion->SetSpeedRate(UnitMoveType(i), m_speed_rate[i]); // Send infinity cooldown - client does that automatically but after relog cooldown needs to be set again - SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(minion->m_unitData->CreatedBySpell, GetMap()->GetDifficultyID()); + SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(minion->m_unitData->CreatedBySpell, DIFFICULTY_NONE); if (spellInfo && (spellInfo->IsCooldownStartedOnEvent())) GetSpellHistory()->StartCooldown(spellInfo, 0, nullptr, true); @@ -5910,7 +5910,7 @@ void Unit::SetMinion(Minion *minion, bool apply) else if (minion->IsTotem()) { // All summoned by totem minions must disappear when it is removed. - if (SpellInfo const* spInfo = sSpellMgr->GetSpellInfo(minion->ToTotem()->GetSpell(), GetMap()->GetDifficultyID())) + if (SpellInfo const* spInfo = sSpellMgr->GetSpellInfo(minion->ToTotem()->GetSpell(), DIFFICULTY_NONE)) { for (SpellEffectInfo const& spellEffectInfo : spInfo->GetEffects()) { @@ -5922,7 +5922,7 @@ void Unit::SetMinion(Minion *minion, bool apply) } } - SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(minion->m_unitData->CreatedBySpell, GetMap()->GetDifficultyID()); + SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(minion->m_unitData->CreatedBySpell, DIFFICULTY_NONE); // Remove infinity cooldown if (spellInfo && (spellInfo->IsCooldownStartedOnEvent())) GetSpellHistory()->SendCooldownEvent(spellInfo); |