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

@ -206,8 +206,7 @@ namespace Server.Items
{
base.OnAfterDelete();
if ( m_Timer != null )
m_Timer.Stop();
m_Timer?.Stop();
}
public InternalItem( Serial serial ) : base( serial )
@ -316,8 +315,7 @@ namespace Server.Items
if ( (m.Z + 16) > m_Item.Z && (m_Item.Z + 12) > m.Z && (!Core.AOS || m != from) && SpellHelper.ValidIndirectTarget( from, m ) && from.CanBeHarmful( m, false ) )
{
if ( from != null )
from.DoHarmful( m );
@from?.DoHarmful( m );
AOS.Damage( m, from, m_Item.GetDamage(), 0, 100, 0, 0, 0 );
m.PlaySound( 0x208 );

View file

@ -104,8 +104,7 @@ namespace Server.Items
Spellbook book = Find( from, -1, type );
if ( book != null )
book.DisplayTo( from );
book?.DisplayTo( @from );
}
private static void EventSink_CastSpellRequest( CastSpellRequestEventArgs e )