Fixes NPE with Protection Spell (#179)
This commit is contained in:
parent
5052bf9af3
commit
eb3f72da99
3 changed files with 39 additions and 39 deletions
|
|
@ -53,6 +53,19 @@ namespace Server.Spells.Second
|
|||
*/
|
||||
|
||||
if (m_Table.TryGetValue(target, out Tuple<ResistanceMod, DefaultSkillMod> mods))
|
||||
{
|
||||
target.PlaySound(0x1ED);
|
||||
target.FixedParticles(0x375A, 9, 20, 5016, EffectLayer.Waist);
|
||||
|
||||
m_Table.Remove(target);
|
||||
Registry.Remove(target);
|
||||
|
||||
target.RemoveResistanceMod(mods.Item1);
|
||||
target.RemoveSkillMod(mods.Item2);
|
||||
|
||||
BuffInfo.RemoveBuff(target, BuffIcon.Protection);
|
||||
}
|
||||
else
|
||||
{
|
||||
target.PlaySound(0x1E9);
|
||||
target.FixedParticles(0x375A, 9, 20, 5016, EffectLayer.Waist);
|
||||
|
|
@ -74,19 +87,6 @@ namespace Server.Spells.Second
|
|||
string args = $"{physloss}\t{resistloss}";
|
||||
BuffInfo.AddBuff(target, new BuffInfo(BuffIcon.Protection, 1075814, 1075815, args));
|
||||
}
|
||||
else
|
||||
{
|
||||
target.PlaySound(0x1ED);
|
||||
target.FixedParticles(0x375A, 9, 20, 5016, EffectLayer.Waist);
|
||||
|
||||
m_Table.Remove(target);
|
||||
Registry.Remove(target);
|
||||
|
||||
target.RemoveResistanceMod(mods.Item1);
|
||||
target.RemoveSkillMod(mods.Item2);
|
||||
|
||||
BuffInfo.RemoveBuff(target, BuffIcon.Protection);
|
||||
}
|
||||
}
|
||||
|
||||
public static void EndProtection(Mobile m)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue