Fixes NPE with Protection Spell (#179)
This commit is contained in:
parent
5052bf9af3
commit
eb3f72da99
3 changed files with 39 additions and 39 deletions
|
|
@ -55,7 +55,19 @@ namespace Server.Spells.Fifth
|
|||
{
|
||||
Mobile targ = Caster;
|
||||
|
||||
if (!m_Table.TryGetValue(targ, out ResistanceMod[] mods))
|
||||
if (m_Table.TryGetValue(targ, out ResistanceMod[] mods))
|
||||
{
|
||||
targ.PlaySound(0x1ED);
|
||||
targ.FixedParticles(0x375A, 10, 15, 5037, EffectLayer.Waist);
|
||||
|
||||
m_Table.Remove(targ);
|
||||
|
||||
for (int i = 0; i < mods.Length; ++i)
|
||||
targ.RemoveResistanceMod(mods[i]);
|
||||
|
||||
BuffInfo.RemoveBuff(targ, BuffIcon.MagicReflection);
|
||||
}
|
||||
else
|
||||
{
|
||||
targ.PlaySound(0x1E9);
|
||||
targ.FixedParticles(0x375A, 10, 15, 5037, EffectLayer.Waist);
|
||||
|
|
@ -81,18 +93,6 @@ namespace Server.Spells.Fifth
|
|||
|
||||
BuffInfo.AddBuff(targ, new BuffInfo(BuffIcon.MagicReflection, 1075817, buffFormat, true));
|
||||
}
|
||||
else
|
||||
{
|
||||
targ.PlaySound(0x1ED);
|
||||
targ.FixedParticles(0x375A, 10, 15, 5037, EffectLayer.Waist);
|
||||
|
||||
m_Table.Remove(targ);
|
||||
|
||||
for (int i = 0; i < mods.Length; ++i)
|
||||
targ.RemoveResistanceMod(mods[i]);
|
||||
|
||||
BuffInfo.RemoveBuff(targ, BuffIcon.MagicReflection);
|
||||
}
|
||||
}
|
||||
|
||||
FinishSequence();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue