More casting fixes
This commit is contained in:
parent
f211efc3bd
commit
20a80ea2f3
40 changed files with 125 additions and 211 deletions
|
|
@ -81,7 +81,7 @@ namespace Server.Mobiles
|
|||
if ( this.Map == null )
|
||||
return;
|
||||
|
||||
if ( attacker is BaseCreature && ((BaseCreature)attacker).BardProvoked )
|
||||
if ( attacker is BaseCreature creature && creature.BardProvoked )
|
||||
return;
|
||||
|
||||
if ( 0.2 > Utility.RandomDouble() )
|
||||
|
|
@ -95,9 +95,9 @@ namespace Server.Mobiles
|
|||
|
||||
Mobile target = null;
|
||||
|
||||
if ( attacker is BaseCreature )
|
||||
if ( attacker is BaseCreature baseCreature )
|
||||
{
|
||||
Mobile m = ((BaseCreature)attacker).GetMaster();
|
||||
Mobile m = baseCreature.GetMaster();
|
||||
|
||||
if ( m != null )
|
||||
target = m;
|
||||
|
|
@ -115,7 +115,7 @@ namespace Server.Mobiles
|
|||
if ( m == this || !CanBeHarmful( m ) )
|
||||
continue;
|
||||
|
||||
if ( m is BaseCreature && (((BaseCreature)m).Controlled || ((BaseCreature)m).Summoned || ((BaseCreature)m).Team != this.Team) )
|
||||
if ( m is BaseCreature bc && (bc.Controlled || bc.Summoned || bc.Team != this.Team))
|
||||
targets.Add( m );
|
||||
else if ( m.Player && m.Alive )
|
||||
targets.Add( m );
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue