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

@ -47,7 +47,7 @@ namespace Server.Engines.ConPVP
defs = new BitArray(basedef.Options);
for (int i = 0; i < ruleset.Flavors.Count; ++i)
defs.Or(((Ruleset)ruleset.Flavors[i]).Options);
defs.Or(ruleset.Flavors[i].Options);
height += ruleset.Flavors.Count * 18;
}
@ -194,7 +194,7 @@ namespace Server.Engines.ConPVP
y += 20;
for (int i = 0; i < ruleset.Flavors.Count; ++i, y += 18)
AddBorderedText(35, y, 190, 20, $" + {((Ruleset)ruleset.Flavors[i]).Title}", LabelColor32, BlackColor32);
AddBorderedText(35, y, 190, 20, $" + {ruleset.Flavors[i].Title}", LabelColor32, BlackColor32);
y += 4;
@ -243,7 +243,7 @@ namespace Server.Engines.ConPVP
y += 35;
y -= 3;
AddButton(314, y, 247, 248, 1, GumpButtonType.Reply, 0);
AddButton(314, y, 247, 248, 1);
Timer.DelayCall(TimeSpan.FromSeconds(15.0), AutoReject);
}
@ -270,9 +270,9 @@ namespace Server.Engines.ConPVP
private void AddColoredText(int x, int y, int width, int height, string text, int color)
{
if (color == 0)
AddHtml(x, y, width, height, text, false, false);
AddHtml(x, y, width, height, text);
else
AddHtml(x, y, width, height, Color(text, color), false, false);
AddHtml(x, y, width, height, Color(text, color));
}
public void AutoReject()
@ -379,4 +379,4 @@ namespace Server.Engines.ConPVP
}
}
}
}
}