Clean up: Bugs, LINQ, constructors, default values, and null checks (#18)

This commit is contained in:
Kamron Batman 2019-03-11 14:29:59 -07:00 committed by GitHub
parent e748af4430
commit 513e54f70e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
1094 changed files with 15913 additions and 21892 deletions

View file

@ -206,6 +206,7 @@ namespace Server.Items
}
catch
{
// ignored
}
}
@ -299,10 +300,7 @@ namespace Server.Items
public static bool HasDiggingTool(Mobile m)
{
if (m.Backpack == null)
return false;
return m.Backpack.FindItemsByType<BaseHarvestTool>().Any(tool => tool.HarvestSystem == Mining.System);
return m.Backpack?.FindItemsByType<BaseHarvestTool>().Any(tool => tool.HarvestSystem == Mining.System) == true;
}
public void OnBeginDig(Mobile from)
@ -820,7 +818,7 @@ namespace Server.Items
Effects.PlaySound(m_Chest, m_Map, 0x33B);
}
if (m_Chest != null && m_Chest.Location.Z >= m_Location.Z)
if (m_Chest?.Location.Z >= m_Location.Z)
{
Stop();
m_From.EndAction<TreasureMap>();
@ -978,4 +976,4 @@ namespace Server.Items
Delete();
}
}
}
}