Fixes bad expressions, bad bool checks in loops, a few null pointer exceptions, and optimizes constructors.

This commit is contained in:
Kamron Batman 2018-09-15 23:16:45 -07:00
parent 8da55d6043
commit f93c3b992e
62 changed files with 318 additions and 634 deletions

View file

@ -37,9 +37,7 @@ namespace Server.Spells.Third
protected override void OnTarget(Mobile from, object o)
{
IPoint3D loc = o as IPoint3D;
if (loc == null)
if (!(o is IPoint3D loc))
return;
if (m_Owner.CheckSequence())
@ -81,7 +79,7 @@ namespace Server.Spells.Third
int level = (int)(from.Skills[SkillName.Magery].Value * 0.8) - 4;
if (level >= cont.RequiredSkill &&
!(cont is TreasureMapChest && ((TreasureMapChest)cont).Level > 2))
!(cont is TreasureMapChest chest && chest.Level > 2))
{
cont.Locked = false;