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:
@@ -1212,21 +1212,26 @@ 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;
|
||||||
foreach (var pair in m_Events.GetEvents())
|
if (abortSpell)
|
||||||
{
|
{
|
||||||
Spell spell = Spell.ExtractSpellFromEvent(pair.Value);
|
foreach (var pair in m_Events.GetEvents())
|
||||||
if (spell != null)
|
|
||||||
{
|
{
|
||||||
if (spell.GetSpellInfo().Id == spellId)
|
Spell spell = Spell.ExtractSpellFromEvent(pair.Value);
|
||||||
|
if (spell != null)
|
||||||
{
|
{
|
||||||
pair.Value.ScheduleAbort();
|
if (spell.GetSpellInfo().Id == spellId)
|
||||||
hasMissile = true;
|
{
|
||||||
|
pair.Value.ScheduleAbort();
|
||||||
|
hasMissile = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
hasMissile = true;
|
||||||
|
|
||||||
if (hasMissile)
|
if (hasMissile)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user