Core/Spells: Prevent manual cancelling of channelled spells that have SPELL_ATTR0_CANT_CANCEL

Port From (https://github.com/TrinityCore/TrinityCore/commit/1fc9e0172da4018ab24422bee51b025d0fb79701)
This commit is contained in:
hondacrx
2022-02-23 16:03:52 -05:00
parent c41acd0bc8
commit 9fffef0388
+12
View File
@@ -473,6 +473,18 @@ namespace Game
if (mover != _player && mover.IsTypeId(TypeId.Player))
return;
var spellInfo = Global.SpellMgr.GetSpellInfo((uint)cancelChanneling.ChannelSpell, mover.GetMap().GetDifficultyID());
if (spellInfo == null)
return;
// not allow remove spells with attr SPELL_ATTR0_CANT_CANCEL
if (spellInfo.HasAttribute(SpellAttr0.CantCancel))
return;
var spell = mover.GetCurrentSpell(CurrentSpellTypes.Channeled);
if (spell == null || spell.GetSpellInfo().Id != spellInfo.Id)
return;
mover.InterruptSpell(CurrentSpellTypes.Channeled);
}