Fixed missing effect index being a uint and not a byte anymore, caused spells with more then 8 effects to not trigger them.

This commit is contained in:
hondacrx
2021-02-28 00:25:48 -05:00
parent 2bf56cfb1b
commit b413849c4d
3 changed files with 12 additions and 12 deletions
+5 -5
View File
@@ -495,7 +495,7 @@ namespace Game.Spells
for (byte effIndex = 0; effIndex < SpellConst.MaxEffects; ++effIndex)
{
if (unit.IsImmunedToSpellEffect(GetSpellInfo(), effIndex, caster))
value &= (byte)~(1 << effIndex);
value &= ~(1u << effIndex);
}
if (value == 0 || unit.IsImmunedToSpell(GetSpellInfo(), caster)
|| !CanBeAppliedOn(unit))
@@ -2660,9 +2660,9 @@ namespace Game.Spells
foreach (var unit in targetList)
{
if (targets.ContainsKey(unit))
targets[unit] |= (byte)(1 << (int)effect.EffectIndex);
targets[unit] |= (1u << (int)effect.EffectIndex);
else
targets[unit] = (byte)(1 << (int)effect.EffectIndex);
targets[unit] = (1u << (int)effect.EffectIndex);
}
}
}
@@ -2722,9 +2722,9 @@ namespace Game.Spells
foreach (var unit in targetList)
{
if (targets.ContainsKey(unit))
targets[unit] |= (byte)(1 << (int)effect.EffectIndex);
targets[unit] |= (1u << (int)effect.EffectIndex);
else
targets[unit] = (byte)(1 << (int)effect.EffectIndex);
targets[unit] = (1u << (int)effect.EffectIndex);
}
}
}