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

@ -39,7 +39,7 @@ namespace Server.Items
return;
}
if (defender is ChaosDragoon || defender is ChaosDragoonElite)
if (defender is ChaosDragoon or ChaosDragoonElite)
{
return;
}

View file

@ -87,7 +87,7 @@ namespace Server.Items
return;
}
if (!(HarvestSystem is Mining))
if (HarvestSystem is not Mining)
{
from.SendLocalizedMessage(1010018); // What do you want to use this item on?
}

View file

@ -199,7 +199,7 @@ namespace Server.Items
{
var item = m.FindItemOnLayer(Layer.OneHanded);
return (item == null || item is Spellbook) && m.FindItemOnLayer(Layer.TwoHanded) == null;
return item is null or Spellbook && m.FindItemOnLayer(Layer.TwoHanded) == null;
}
private static void EventSink_DisarmRequest(Mobile m)

View file

@ -53,7 +53,7 @@ namespace Server.Items
if (canSwing)
{
canSwing = !(attacker.Spell is Spell sp) || !sp.IsCasting || !sp.BlocksMovement;
canSwing = attacker.Spell is not Spell sp || !sp.IsCasting || !sp.BlocksMovement;
}
}

View file

@ -43,7 +43,7 @@ namespace Server.Items
public void OnTargetGears(Mobile from, object targ)
{
if (!(targ is Gears g) || !g.IsChildOf(from.Backpack))
if (targ is not Gears g || !g.IsChildOf(from.Backpack))
{
from.SendMessage(
"Those are not gears."