Clean up: Bugs, LINQ, constructors, default values, and null checks (#18)
This commit is contained in:
parent
e748af4430
commit
513e54f70e
1094 changed files with 15913 additions and 21892 deletions
|
|
@ -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
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue