Clean up: Bugs, LINQ, constructors, default values, and null checks (#18)

This commit is contained in:
Kamron Batman 2019-03-11 14:29:59 -07:00 • committed by GitHub
parent e748af4430
commit 513e54f70e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
1094 changed files with 15913 additions and 21892 deletions

View file

@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using System.Linq;
using Server.Items;
using Server.Mobiles;
using Server.Targeting;
@ -15,7 +16,7 @@ namespace Server.Spells.Necromancy
Reagent.NoxCrystal
);
public PoisonStrikeSpell(Mobile caster, Item scroll)
public PoisonStrikeSpell(Mobile caster, Item scroll = null)
: base(caster, scroll, m_Info)
{
}
@ -67,11 +68,8 @@ namespace Server.Spells.Necromancy
if (Caster.CanBeHarmful(m, false))
targets.Add(m);
foreach (Mobile targ in m.GetMobilesInRange(2))
if (!(Caster is BaseCreature && targ is BaseCreature))
if (targ != Caster && m != targ && SpellHelper.ValidIndirectTarget(Caster, targ) &&
Caster.CanBeHarmful(targ, false))
targets.Add(targ);
targets.AddRange(m.GetMobilesInRange(2)
.Where(targ => !(Caster is BaseCreature && targ is BaseCreature && targ != Caster && m != targ && SpellHelper.ValidIndirectTarget(Caster, targ) && Caster.CanBeHarmful(targ, false))));
for (int i = 0; i < targets.Count; ++i)
{
@ -117,4 +115,4 @@ namespace Server.Spells.Necromancy
}
}
}
}
}