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

@ -38,16 +38,14 @@ namespace Server.Engines.MLQuests.Gumps
AddBackground(0, 0, 240, 135, 0x2422);
if (targetRace == Race.Human)
AddHtmlLocalized(15, 15, 210, 75, 1073643, 0, false,
false); // Are you sure you wish to embrace your humanity?
AddHtmlLocalized(15, 15, 210, 75, 1073643, 0); // Are you sure you wish to embrace your humanity?
else if (targetRace == Race.Elf)
AddHtmlLocalized(15, 15, 210, 75, 1073642, 0, false,
false); // Are you sure you want to follow the elven ways?
AddHtmlLocalized(15, 15, 210, 75, 1073642, 0); // Are you sure you want to follow the elven ways?
else
AddHtml(15, 15, 210, 75, $"Are you sure you want to change your race to {targetRace.Name}?", false, false);
AddHtml(15, 15, 210, 75, $"Are you sure you want to change your race to {targetRace.Name}?");
AddButton(160, 95, 0xF7, 0xF8, 1, GumpButtonType.Reply, 0);
AddButton(90, 95, 0xF2, 0xF1, 0, GumpButtonType.Reply, 0);
AddButton(160, 95, 0xF7, 0xF8, 1);
AddButton(90, 95, 0xF2, 0xF1, 0);
}
public override void OnResponse(NetState sender, RelayInfo info)
@ -186,7 +184,7 @@ namespace Server.Engines.MLQuests.Gumps
return;
}
if (!CanChange(pm, targetRace) || owner != null && !owner.CheckComplete(pm))
if (!CanChange(pm, targetRace) || owner?.CheckComplete(pm) == false)
return;
int hue = pvSrc.ReadUInt16();