Clean up: Bugs, LINQ, constructors, default values, and null checks (#18)
This commit is contained in:
parent
e748af4430
commit
513e54f70e
1094 changed files with 15913 additions and 21892 deletions
|
|
@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue