Fixes a Assert with calling GetUnitOwner when aura is a DynObjAura.

Not sure if this is the right fix, or if there is more places it should be changed.
This commit is contained in:
hondacrx
2021-07-03 20:42:57 -04:00
parent 1d5337d3f7
commit 868bbf9edd
2 changed files with 4 additions and 4 deletions
+2 -2
View File
@@ -352,7 +352,7 @@ namespace Game.Spells
foreach (SpellEffectInfo effect in GetSpellInfo().GetEffects())
{
if (effect != null && Convert.ToBoolean(effMask & (1 << (int)effect.EffectIndex)))
_effects[effect.EffectIndex] = new AuraEffect(this, effect, baseAmount != null ? baseAmount[effect.EffectIndex] : (int?)null, caster);
_effects[effect.EffectIndex] = new AuraEffect(this, effect, baseAmount != null ? baseAmount[effect.EffectIndex] : null, caster);
}
}
@@ -2672,7 +2672,7 @@ namespace Game.Spells
Cell.VisitAllObjects(GetDynobjOwner(), searcher, radius);
// by design WorldObjectSpellAreaTargetCheck allows not-in-world units (for spells) but for auras it is not acceptable
targetList.RemoveAll(unit => !unit.IsSelfOrInSameMap(GetUnitOwner()));
targetList.RemoveAll(unit => !unit.IsSelfOrInSameMap(GetOwner()));
foreach (var unit in targetList)
{
+2 -2
View File
@@ -132,10 +132,10 @@ namespace Game.Spells
{
case AuraType.PeriodicDamage:
case AuraType.PeriodicLeech:
_estimatedAmount = caster.SpellDamageBonusDone(GetBase().GetUnitOwner(), GetSpellInfo(), (uint)amount, DamageEffectType.DOT, GetSpellEffectInfo(), stackAmountForBonuses);
_estimatedAmount = caster.SpellDamageBonusDone(GetBase().GetOwner().ToUnit(), GetSpellInfo(), (uint)amount, DamageEffectType.DOT, GetSpellEffectInfo(), stackAmountForBonuses);
break;
case AuraType.PeriodicHeal:
_estimatedAmount = caster.SpellHealingBonusDone(GetBase().GetUnitOwner(), GetSpellInfo(), (uint)amount, DamageEffectType.DOT, GetSpellEffectInfo(), stackAmountForBonuses);
_estimatedAmount = caster.SpellHealingBonusDone(GetBase().GetOwner().ToUnit(), GetSpellInfo(), (uint)amount, DamageEffectType.DOT, GetSpellEffectInfo(), stackAmountForBonuses);
break;
default:
break;