Fixes null propogation

This commit is contained in:
Kamron Batman 2018-09-14 13:49:23 -07:00
parent 22ab83ea9e
commit 3c9842ee5a
218 changed files with 799 additions and 1458 deletions

View file

@ -99,8 +99,7 @@ namespace Server.Spells.Fifth
protected override void OnTargetFinish( Mobile from )
{
if ( m_Owner != null )
m_Owner.FinishSequence();
m_Owner?.FinishSequence();
}
}
}

View file

@ -171,8 +171,7 @@ namespace Server.Spells.Fifth
{
if ( !m_Owner.CanBeginAction( typeof( IncognitoSpell ) ) )
{
if ( m_Owner is PlayerMobile )
((PlayerMobile)m_Owner).SetHairMods( -1, -1 );
(m_Owner as PlayerMobile)?.SetHairMods( -1, -1 );
m_Owner.BodyMod = 0;
m_Owner.HueMod = -1;

View file

@ -114,8 +114,7 @@ namespace Server.Spells.Fifth
{
base.OnAfterDelete();
if ( m_Timer != null )
m_Timer.Stop();
m_Timer?.Stop();
}
public InternalItem( Serial serial ) : base( serial )
@ -187,8 +186,7 @@ namespace Server.Spells.Fifth
if ( SpellHelper.CanRevealCaster( m ) )
m_Caster.RevealingAction();
if ( m is BaseCreature )
( (BaseCreature) m ).OnHarmfulSpell( m_Caster );
(m as BaseCreature)?.OnHarmfulSpell( m_Caster );
}
public override bool OnMoveOver( Mobile m )