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

@ -55,7 +55,7 @@ namespace Server.Spells.Third
{
item.OnSnoop(Caster);
}
else if (item is Corpse && !((Corpse)item).CheckLoot(Caster, null))
else if (item is Corpse corpse && !corpse.CheckLoot(Caster, null))
{
}
else if (Caster.Region.OnDoubleClick(Caster, item))
@ -82,10 +82,10 @@ namespace Server.Spells.Third
protected override void OnTarget(Mobile from, object o)
{
if (o is ITelekinesisable)
m_Owner.Target((ITelekinesisable)o);
else if (o is Container)
m_Owner.Target((Container)o);
if (o is ITelekinesisable telekinesisable)
m_Owner.Target(telekinesisable);
else if (o is Container container)
m_Owner.Target(container);
else
from.SendLocalizedMessage(501857); // This spell won't work on that!
}