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

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

View file

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