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:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user