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

@ -169,14 +169,8 @@ namespace Server.Items
private Mobile m_Hunter;
[Constructible]
public TrophyAddon(Mobile from, int itemID, int westID, int northID, int deedNumber, int addonNumber) : this(from,
itemID, westID, northID, deedNumber, addonNumber, null, 0)
{
}
public TrophyAddon(Mobile from, int itemID, int westID, int northID, int deedNumber, int addonNumber, Mobile hunter,
int animalWeight) : base(itemID)
public TrophyAddon(Mobile from, int itemID, int westID, int northID, int deedNumber,
int addonNumber, Mobile hunter = null, int animalWeight = 0) : base(itemID)
{
WestID = westID;
NorthID = northID;
@ -335,7 +329,7 @@ namespace Server.Items
{
BaseHouse house = BaseHouse.FindHouseAt(this);
if (house != null && house.IsCoOwner(from))
if (house?.IsCoOwner(from) == true)
{
if (from.InRange(GetWorldLocation(), 1))
{
@ -358,14 +352,8 @@ namespace Server.Items
private Mobile m_Hunter;
[Constructible]
public TrophyDeed(int westID, int northID, int deedNumber, int addonNumber) : this(westID, northID, deedNumber,
addonNumber, null, 0)
{
}
public TrophyDeed(int westID, int northID, int deedNumber, int addonNumber, Mobile hunter, int animalWeight) :
base(0x14F0)
public TrophyDeed(int westID, int northID, int deedNumber, int addonNumber,
Mobile hunter = null, int animalWeight = 0) : base(0x14F0)
{
WestID = westID;
NorthID = northID;
@ -487,7 +475,7 @@ namespace Server.Items
{
BaseHouse house = BaseHouse.FindHouseAt(from);
if (house != null && house.IsCoOwner(from))
if (house?.IsCoOwner(from) == true)
{
bool northWall = BaseAddon.IsWall(from.X, from.Y - 1, from.Z, from.Map);
bool westWall = BaseAddon.IsWall(from.X - 1, from.Y, from.Z, from.Map);
@ -497,14 +485,12 @@ namespace Server.Items
{
case Direction.North:
case Direction.South:
northWall = true;
westWall = false;
break;
case Direction.East:
case Direction.West:
northWall = false;
westWall = true;
break;
default: