Fixes sequential checks

This commit is contained in:
Kamron Batman 2018-09-14 13:00:41 -07:00
parent 83dcf536d8
commit 42d0b6271f
67 changed files with 99 additions and 99 deletions

View file

@ -124,7 +124,7 @@ namespace Server.Items
protected override void OnTick()
{
if ( m_Mobile == null || m_Mobile.Map == null || m_Mobile.Deleted || !m_Mobile.Alive || m_Mobile.Map == Map.Internal )
if ( m_Mobile?.Map == null || m_Mobile.Deleted || !m_Mobile.Alive || m_Mobile.Map == Map.Internal )
{
Stop();
}

View file

@ -236,8 +236,8 @@ namespace Server.Gumps
public int Compare( RaffleEntry x, RaffleEntry y )
{
bool xIsNull = ( x == null || x.From == null );
bool yIsNull = ( y == null || y.From == null );
bool xIsNull = ( x?.From == null );
bool yIsNull = ( y?.From == null );
if ( xIsNull && yIsNull )
return 0;
@ -265,8 +265,8 @@ namespace Server.Gumps
public int Compare( RaffleEntry x, RaffleEntry y )
{
bool xIsNull = ( x == null || x.From == null );
bool yIsNull = ( y == null || y.From == null );
bool xIsNull = ( x?.From == null );
bool yIsNull = ( y?.From == null );
if ( xIsNull && yIsNull )
return 0;
@ -304,8 +304,8 @@ namespace Server.Gumps
public int Compare( RaffleEntry x, RaffleEntry y )
{
bool xIsNull = ( x == null || x.Address == null );
bool yIsNull = ( y == null || y.Address == null );
bool xIsNull = ( x?.Address == null );
bool yIsNull = ( y?.Address == null );
if ( xIsNull && yIsNull )
return 0;

View file

@ -54,7 +54,7 @@ namespace Server.Regions
public override bool OnTarget( Mobile m, Target t, object o )
{
if ( m.Spell != null && m.Spell is MarkSpell && m.AccessLevel == AccessLevel.Player )
if ( m.Spell is MarkSpell && m.AccessLevel == AccessLevel.Player )
{
m.SendLocalizedMessage( 501800 ); // You cannot mark an object at that location.
return false;

View file

@ -536,7 +536,7 @@ namespace Server.Items
AddComponent( new PlagueBeastComponent( 0x1363, 0x1 ), 0, 22 );
AddComponent( new PlagueBeastComponent( 0x1D04, 0xD ), 0, 22 );
if ( Owner != null && Owner.Backpack != null )
if ( Owner?.Backpack != null )
{
PlagueBeastMutationCore core = new PlagueBeastMutationCore();
Owner.Backpack.AddItem( core );

View file

@ -32,7 +32,7 @@
{
IEntity rootParent = RootParent;
if ( rootParent != null && rootParent.Map != null && rootParent.Map != Map.Internal )
if ( rootParent?.Map != null && rootParent.Map != Map.Internal )
MoveToWorld( rootParent.Location, rootParent.Map );
}

View file

@ -252,7 +252,7 @@ namespace Server.Items
from.SendLocalizedMessage( 1054004 ); // You must equip the bracelet in order to use its power.
return false;
}
else if ( boundRoot == null || boundRoot.NetState == null || boundRoot.FindItemOnLayer( Layer.Bracelet ) != bound )
else if ( boundRoot?.NetState == null || boundRoot.FindItemOnLayer( Layer.Bracelet ) != bound )
{
from.SendLocalizedMessage( 1054006 ); // The bracelet emits a red glow. The bracelet's twin is not available for transport.
return false;