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

@ -99,16 +99,11 @@ namespace Server.Mobiles
{
base.OnGotMeleeAttack( attacker );
if ( !Core.SE && 0.2 > Utility.RandomDouble() && attacker is BaseCreature )
if ( !Core.SE && 0.2 > Utility.RandomDouble() && attacker is BaseCreature c && c.Controlled && c.ControlMaster != null )
{
BaseCreature c = (BaseCreature)attacker;
if ( c.Controlled && c.ControlMaster != null )
{
c.ControlTarget = c.ControlMaster;
c.ControlOrder = OrderType.Attack;
c.Combatant = c.ControlMaster;
}
c.ControlTarget = c.ControlMaster;
c.ControlOrder = OrderType.Attack;
c.Combatant = c.ControlMaster;
}
}