Core/Spells: Allow cancelling spell missiles without cancelling the entire spell

Port From (https://github.com/TrinityCore/TrinityCore/commit/ed98146d317f9b956e8ca23524631cdd2388492b)
This commit is contained in:
hondacrx
2023-09-14 06:59:49 -04:00
parent 25b27dcc72
commit b99f574f64
+6 -1
View File
@@ -1212,9 +1212,11 @@ namespace Game.Entities
SendMessageToSet(cancelSpellVisualKit, true); SendMessageToSet(cancelSpellVisualKit, true);
} }
public void CancelSpellMissiles(uint spellId, bool reverseMissile = false) public void CancelSpellMissiles(uint spellId, bool reverseMissile = false, bool abortSpell = false)
{ {
bool hasMissile = false; bool hasMissile = false;
if (abortSpell)
{
foreach (var pair in m_Events.GetEvents()) foreach (var pair in m_Events.GetEvents())
{ {
Spell spell = Spell.ExtractSpellFromEvent(pair.Value); Spell spell = Spell.ExtractSpellFromEvent(pair.Value);
@@ -1227,6 +1229,9 @@ namespace Game.Entities
} }
} }
} }
}
else
hasMissile = true;
if (hasMissile) if (hasMissile)
{ {