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

@ -143,7 +143,7 @@ namespace Server.Mobiles
if (m_Rider != null)
m_Rider.Followers -= FollowerSlots;
if (m_Rider != null && m_Rider.Followers < 0)
if (m_Rider?.Followers < 0)
m_Rider.Followers = 0;
}
@ -161,8 +161,9 @@ namespace Server.Mobiles
return false;
}
if (IsRewardItem && !RewardSystem.CheckIsUsableBy(from, this, null)) return false;
if (!BaseMount.CheckMountAllowed(from)) return false;
if (IsRewardItem && !RewardSystem.CheckIsUsableBy(from, this) || !BaseMount.CheckMountAllowed(from))
return false;
if (from.Mounted)
{
from.SendLocalizedMessage(1005583); // Please dismount first.
@ -187,9 +188,7 @@ namespace Server.Mobiles
return false;
}
if (!DesignContext.Check(from)) return false;
return true;
return DesignContext.Check(from);
}
public override void OnDoubleClick(Mobile from)
@ -202,10 +201,7 @@ namespace Server.Mobiles
{
base.OnSingleClick(from);
if (m_IsDonationItem)
LabelTo(from, "Donation Ethereal");
else
LabelTo(from, "Veteran Reward");
LabelTo(from, m_IsDonationItem ? "Donation Ethereal" : "Veteran Reward");
}
public override void Serialize(GenericWriter writer)
@ -840,4 +836,4 @@ namespace Server.Mobiles
if (version <= 1 && Hue != 0) Hue = 0;
}
}
}
}