Core/Spells: Fixed a crash on collection was modified.

This commit is contained in:
hondacrx
2021-03-18 12:20:56 -04:00
parent d20893944c
commit 62f554f2e0
2 changed files with 4 additions and 3 deletions
+2 -2
View File
@@ -1531,7 +1531,7 @@ namespace Game.Spells
[AuraEffectHandler(AuraType.ModScale)] [AuraEffectHandler(AuraType.ModScale)]
[AuraEffectHandler(AuraType.ModScale2)] [AuraEffectHandler(AuraType.ModScale2)]
public void HandleAuraModScale(AuraApplication aurApp, AuraEffectHandleModes mode, bool apply) void HandleAuraModScale(AuraApplication aurApp, AuraEffectHandleModes mode, bool apply)
{ {
if (!mode.HasAnyFlag(AuraEffectHandleModes.ChangeAmountSendForClientMask)) if (!mode.HasAnyFlag(AuraEffectHandleModes.ChangeAmountSendForClientMask))
return; return;
@@ -5380,7 +5380,7 @@ namespace Game.Spells
Log.outError(LogFilter.Spells, "AuraEffect.HandleProcTriggerSpellWithValueAuraProc: Could not trigger spell {0} from aura {1} proc, because the spell does not have an entry in Spell.dbc.", triggerSpellId, GetId()); Log.outError(LogFilter.Spells, "AuraEffect.HandleProcTriggerSpellWithValueAuraProc: Could not trigger spell {0} from aura {1} proc, because the spell does not have an entry in Spell.dbc.", triggerSpellId, GetId());
} }
public void HandleProcTriggerDamageAuraProc(AuraApplication aurApp, ProcEventInfo eventInfo) void HandleProcTriggerDamageAuraProc(AuraApplication aurApp, ProcEventInfo eventInfo)
{ {
Unit target = aurApp.GetTarget(); Unit target = aurApp.GetTarget();
Unit triggerTarget = eventInfo.GetProcTarget(); Unit triggerTarget = eventInfo.GetProcTarget();
+2 -1
View File
@@ -3240,8 +3240,9 @@ namespace Game.Spells
unitTarget.GetHostileRefManager().UpdateVisibility(); unitTarget.GetHostileRefManager().UpdateVisibility();
var attackers = unitTarget.GetAttackers(); var attackers = unitTarget.GetAttackers();
foreach (var unit in attackers) for (var i = 0; i < attackers.Count; ++i)
{ {
var unit = attackers[i];
if (!unit.CanSeeOrDetect(unitTarget)) if (!unit.CanSeeOrDetect(unitTarget))
unit.AttackStop(); unit.AttackStop();
} }