chore: Cleans up pattern checks. (#892)

This commit is contained in:
Kamron Batman 2021-12-24 15:53:59 -08:00 • committed by GitHub
parent 171df32257
commit 63e1b02d93
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
283 changed files with 587 additions and 702 deletions

View file

@ -40,7 +40,7 @@ namespace Server.Guilds
public override void OnResponse(NetState sender, RelayInfo info)
{
if (!(sender.Mobile is PlayerMobile pm))
if (sender.Mobile is not PlayerMobile pm)
{
return;
}
@ -71,11 +71,11 @@ namespace Server.Guilds
}
public static bool IsLeader(Mobile m, Guild g) =>
!(m.Deleted || g.Disbanded || !(m is PlayerMobile) ||
!(m.Deleted || g.Disbanded || m is not PlayerMobile ||
m.AccessLevel < AccessLevel.GameMaster && g.Leader != m);
public static bool IsMember(Mobile m, Guild g) =>
!(m.Deleted || g.Disbanded || !(m is PlayerMobile) ||
!(m.Deleted || g.Disbanded || m is not PlayerMobile ||
m.AccessLevel < AccessLevel.GameMaster && !g.IsMember(m));
public static bool CheckProfanity(string s, int maxLength = 50)
@ -96,7 +96,7 @@ namespace Server.Guilds
{
var c = s[i];
if ((c < 'a' || c > 'z') && (c < '0' || c > '9'))
if (c is < 'a' or > 'z' && c is < '0' or > '9')
{
var except = false;