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

@ -10,7 +10,7 @@ namespace Server.Items
public class CommodityDeed : Item
{
public CommodityDeed(Item commodity) : base(0x14F0)
public CommodityDeed(Item commodity = null) : base(0x14F0)
{
Weight = 1.0;
Hue = 0x47;
@ -20,11 +20,6 @@ namespace Server.Items
LootType = LootType.Blessed;
}
[Constructible]
public CommodityDeed() : this(null)
{
}
public CommodityDeed(Serial serial) : base(serial)
{
}
@ -167,7 +162,7 @@ namespace Server.Items
number = 1047024; // To claim the resources ....
}
}
else if (cox != null && !cox.IsSecure)
else if (cox?.IsSecure == false)
{
number = 1080525; // The commodity deed box must be secured before you can use it.
}
@ -215,7 +210,7 @@ namespace Server.Items
// Veteran Rewards mods
if (box != null && m_Deed.IsChildOf(box) && item.IsChildOf(box) ||
cox != null && cox.IsSecure && item.IsChildOf(cox))
cox?.IsSecure != true && item.IsChildOf(cox))
{
if (m_Deed.SetCommodity(item))
{
@ -245,4 +240,4 @@ namespace Server.Items
}
}
}
}
}