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

@ -178,7 +178,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 creature && (creature.Controlled || creature.Summoned || creature.Team != this.Team))
targets.Add(m);
else if (m.Player)
targets.Add(m);
@ -187,15 +187,14 @@ namespace Server.Mobiles
for (int i = 0; i < targets.Count; ++i)
{
Mobile m = (Mobile)targets[i];
if ( m != null && !m.Deleted && m is PlayerMobile )
if ( m != null && !m.Deleted && m is PlayerMobile pm )
{
PlayerMobile pm = m as PlayerMobile;
if (pm != null && pm.Mounted)
if (pm.Mounted)
{
pm.Mount.Rider=null;
pm.Mount.Rider = null;
}
}
double damage = m.Hits * 0.6;//was .6
double damage = m.Hits * 0.6; //was .6
if (damage < 10.0)
damage = 10.0;
else if (damage > 75.0)