Fixes implicit ternary expressions

This commit is contained in:
Kamron Batman 2018-09-14 14:56:48 -07:00
parent c85b0a740c
commit ff26dfa375
345 changed files with 1905 additions and 2336 deletions

View file

@ -91,7 +91,8 @@ namespace Server.Mobiles
Kill();
return;
}
else if ( Map != m_Target.Map || !InRange( m_Target, 15 ) )
if ( Map != m_Target.Map || !InRange( m_Target, 15 ) )
{
Map fromMap = Map;
Point3D from = Location;
@ -110,15 +111,13 @@ namespace Server.Mobiles
to = loc;
break;
}
else
{
loc.Z = toMap.GetAverageZ( loc.X, loc.Y );
if ( toMap.CanSpawnMobile( loc ) )
{
to = loc;
break;
}
loc.Z = toMap.GetAverageZ( loc.X, loc.Y );
if ( toMap.CanSpawnMobile( loc ) )
{
to = loc;
break;
}
}
}

View file

@ -79,8 +79,7 @@ namespace Server.Mobiles
{
if ( SolenHelper.CheckBlackFriendship( m ) )
return false;
else
return base.IsEnemy( m );
return base.IsEnemy( m );
}
public override void OnDamage( int amount, Mobile from, bool willKill )

View file

@ -80,8 +80,7 @@ namespace Server.Mobiles
{
if ( SolenHelper.CheckBlackFriendship( m ) )
return false;
else
return base.IsEnemy( m );
return base.IsEnemy( m );
}
public override void OnDamage( int amount, Mobile from, bool willKill )

View file

@ -86,8 +86,7 @@ namespace Server.Mobiles
{
if ( SolenHelper.CheckBlackFriendship( m ) )
return false;
else
return base.IsEnemy( m );
return base.IsEnemy( m );
}
public override void OnDamage( int amount, Mobile from, bool willKill )

View file

@ -87,8 +87,7 @@ namespace Server.Mobiles
{
if ( SolenHelper.CheckBlackFriendship( m ) )
return false;
else
return base.IsEnemy( m );
return base.IsEnemy( m );
}
public override void OnDamage( int amount, Mobile from, bool willKill )

View file

@ -80,8 +80,7 @@ namespace Server.Mobiles
{
if ( SolenHelper.CheckBlackFriendship( m ) )
return false;
else
return base.IsEnemy( m );
return base.IsEnemy( m );
}
public override void OnDamage( int amount, Mobile from, bool willKill )

View file

@ -78,8 +78,7 @@ namespace Server.Mobiles
{
if ( SolenHelper.CheckRedFriendship( m ) )
return false;
else
return base.IsEnemy( m );
return base.IsEnemy( m );
}
public override void OnDamage( int amount, Mobile from, bool willKill )

View file

@ -80,8 +80,7 @@ namespace Server.Mobiles
{
if ( SolenHelper.CheckRedFriendship( m ) )
return false;
else
return base.IsEnemy( m );
return base.IsEnemy( m );
}
public override void OnDamage( int amount, Mobile from, bool willKill )

View file

@ -86,8 +86,7 @@ namespace Server.Mobiles
{
if ( SolenHelper.CheckRedFriendship( m ) )
return false;
else
return base.IsEnemy( m );
return base.IsEnemy( m );
}
public override void OnDamage( int amount, Mobile from, bool willKill )

View file

@ -86,8 +86,7 @@ namespace Server.Mobiles
{
if ( SolenHelper.CheckRedFriendship( m ) )
return false;
else
return base.IsEnemy( m );
return base.IsEnemy( m );
}
public override void OnDamage( int amount, Mobile from, bool willKill )

View file

@ -79,8 +79,7 @@ namespace Server.Mobiles
{
if ( SolenHelper.CheckRedFriendship( m ) )
return false;
else
return base.IsEnemy( m );
return base.IsEnemy( m );
}
public override void OnDamage( int amount, Mobile from, bool willKill )

View file

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

View file

@ -53,8 +53,7 @@ namespace Server.Mobiles
{
if ( Utility.RandomBool() )
return WeaponAbility.ParalyzingBlow;
else
return WeaponAbility.BleedAttack;
return WeaponAbility.BleedAttack;
}
public override bool GivesMLMinorArtifact => true;

View file

@ -50,8 +50,7 @@ namespace Server.Mobiles
{
if ( Utility.RandomBool() )
return WeaponAbility.ParalyzingBlow;
else
return WeaponAbility.BleedAttack;
return WeaponAbility.BleedAttack;
}
public override bool GivesMLMinorArtifact => true;

View file

@ -64,7 +64,7 @@ namespace Server.Mobiles
public override void AlterMeleeDamageFrom( Mobile from, ref int damage )
{
if ( @from is BaseCreature bc )
if ( from is BaseCreature bc )
{
if ( bc.Controlled || bc.BardTarget == this )
damage = 0; // Immune to pets and provoked creatures

View file

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