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

@ -29,9 +29,7 @@ namespace Server.Mobiles
{
for ( int i = 0; i < pack.Items.Count; i++ )
{
PlagueBeastBlood blood = pack.Items[ i ] as PlagueBeastBlood;
if ( blood != null && !blood.Patched )
if ( pack.Items[ i ] is PlagueBeastBlood blood && !blood.Patched )
return true;
}
}
@ -107,7 +105,7 @@ namespace Server.Mobiles
public override void OnDelete()
{
if ( m_OpenedBy != null && m_OpenedBy.Holding is PlagueBeastInnard )
if ( m_OpenedBy?.Holding is PlagueBeastInnard )
m_OpenedBy.Holding.Delete();
if ( Backpack != null )