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

@ -67,7 +67,7 @@ namespace Server.Mobiles
// When we have no ammo, we flee
Container pack = m_Mobile.Backpack;
if ( pack == null || pack.FindItemByType( typeof( Arrow ) ) == null )
if ( pack?.FindItemByType( typeof( Arrow ) ) == null )
{
Action = ActionType.Flee;
return true;

View file

@ -48,7 +48,7 @@ namespace Server.Mobiles
public static bool IsInsideKhaldun( Mobile from )
{
return from != null && from.Region != null && from.Region.IsPartOf( "Khaldun" );
return @from?.Region != null && @from.Region.IsPartOf( "Khaldun" );
}
private Mobile m_Target;

View file

@ -196,7 +196,7 @@ namespace Server.Mobiles
public bool Devour( Corpse corpse )
{
if ( corpse == null || corpse.Owner == null ) // sorry we can't devour because the corpse's owner is null
if ( corpse?.Owner == null ) // sorry we can't devour because the corpse's owner is null
return false;
if ( corpse.Owner.Body.IsHuman )

View file

@ -146,7 +146,7 @@ namespace Server.Mobiles
public override void OnDamage( int amount, Mobile from, bool willKill )
{
if ( from != null && from.Map != null )
if ( @from?.Map != null )
{
int amt=0;
Mobile target = this;

View file

@ -105,7 +105,7 @@ namespace Server.Mobiles
BaseShield shield = Shield;
Item twoHanded = from.FindItemOnLayer( Layer.TwoHanded );
if ( (pack != null && pack.FindItemByType( shield.GetType() ) != null) || ( twoHanded != null && shield.GetType().IsAssignableFrom( twoHanded.GetType() ) ) )
if ( (pack?.FindItemByType( shield.GetType() ) != null) || ( twoHanded != null && shield.GetType().IsAssignableFrom( twoHanded.GetType() ) ) )
{
Say( 1007110 ); // Why dost thou ask about virtue guards when thou art one?
shield.Delete();

View file

@ -220,7 +220,7 @@ namespace Server.Mobiles
VendorItem vi = pv.GetVendorItem( item );
if ( vi != null && vi.Description != null && vi.Description.Length > 0 )
if ( vi?.Description != null && vi.Description.Length > 0 )
list.Add( 1043305, vi.Description ); // <br>Seller's Description:<br>"~1_DESC~"
}