More casting fixes

This commit is contained in:
Kamron Batman 2018-09-11 18:59:11 -07:00
parent f211efc3bd
commit 20a80ea2f3
40 changed files with 125 additions and 211 deletions

View file

@ -239,12 +239,7 @@ namespace Server.Mobiles
else if ( !Combat( SummonMaster ))
{
BaseCreature bc = null;
if ( Combatant is BaseCreature )
{
bc = (BaseCreature)Combatant;
}
if ( Combatant.Player || ( bc != null && ( bc.Controlled || bc.SummonMaster != null )))
if ( Combatant.Player || ( Combatant is BaseCreature bc && ( bc.Controlled || bc.SummonMaster != null )))
{
SummonMaster.Combatant = Combatant;
}
@ -258,14 +253,9 @@ namespace Server.Mobiles
private bool Combat( Mobile mobile )
{
Mobile combatant = mobile.Combatant;
if ( combatant == null || combatant.Deleted )
{
if ( combatant == null || combatant.Deleted || combatant.IsDeadBondedPet || !combatant.Alive )
return false;
}
else if ( combatant.IsDeadBondedPet || !combatant.Alive )
{
return false;
}
return true;
}