From 3cba8c43f8bea35e30eeb5b294508edabc43c16d Mon Sep 17 00:00:00 2001 From: Kamron Batman <3953314+kamronbatman@users.noreply.github.com> Date: Fri, 24 Dec 2021 15:56:07 -0800 Subject: [PATCH] fix: Removes from literals (#893) --- Projects/UOContent/Accounting/AccountHandler.cs | 2 +- Projects/UOContent/Commands/Handlers.cs | 2 +- Projects/UOContent/Commands/Logging.cs | 2 +- Projects/UOContent/Engines/ConPVP/DuelContext.cs | 2 +- Projects/UOContent/Engines/Help/PageQueue.cs | 2 +- .../UOContent/Engines/ML Quests/Gumps/RaceChangeGump.cs | 2 +- .../UOContent/Engines/ML Quests/Items/PrismaticCrystal.cs | 2 +- .../UOContent/Engines/Quests/Dark Tides/DarkTidesQuest.cs | 2 +- .../Engines/Quests/Dark Tides/Items/KronusScroll.cs | 2 +- .../Quests/Emino's Undertaking/EminosUndertakingQuest.cs | 4 ++-- .../Engines/Quests/Haochi's Trials/HaochisTrialsQuest.cs | 2 +- .../Engines/Quests/Haochi's Trials/Items/HonorCandle.cs | 2 +- .../Engines/Quests/Solen Matriarch/Objectives.cs | 4 ++-- .../Engines/Quests/Uzeraan Turmoil/Objectives.cs | 2 +- .../Engines/Quests/Uzeraan Turmoil/UzeraanTurmoilQuest.cs | 8 ++++---- .../Gumps/Guilds/New Guild System/GuildMemberInfoGump.cs | 2 +- .../Gumps/Guilds/New Guild System/OtherGuildInfo.cs | 2 +- Projects/UOContent/Items/Addons/DartBoard.cs | 2 +- Projects/UOContent/Items/Misc/Corpses/Corpse.cs | 2 +- .../Items/Skill Items/Harvest Tools/BaseHarvestTool.cs | 2 +- .../Items/Special/House Raffle/HouseRaffleStone.cs | 4 ++-- Projects/UOContent/Items/Special/SoulStone.cs | 2 +- Projects/UOContent/Items/Wands/BaseWand.cs | 2 +- Projects/UOContent/Mobiles/PlayerMobile.cs | 2 +- Projects/UOContent/Mobiles/Special/BaseShieldGuard.cs | 2 +- Projects/UOContent/Spells/Spellweaving/ArcanistSpell.cs | 2 +- 26 files changed, 32 insertions(+), 32 deletions(-) diff --git a/Projects/UOContent/Accounting/AccountHandler.cs b/Projects/UOContent/Accounting/AccountHandler.cs index 55c6a7598..642660d05 100644 --- a/Projects/UOContent/Accounting/AccountHandler.cs +++ b/Projects/UOContent/Accounting/AccountHandler.cs @@ -110,7 +110,7 @@ namespace Server.Misc { var from = e.Mobile; - if (@from.Account is not Account acct) + if (from.Account is not Account acct) { return; } diff --git a/Projects/UOContent/Commands/Handlers.cs b/Projects/UOContent/Commands/Handlers.cs index 94a7f9395..98279f8ed 100644 --- a/Projects/UOContent/Commands/Handlers.cs +++ b/Projects/UOContent/Commands/Handlers.cs @@ -595,7 +595,7 @@ namespace Server.Commands { map = Map.AllMaps[i]; - if (map.MapIndex is 0x7F or 0xFF || @from.Map == map) + if (map.MapIndex is 0x7F or 0xFF || from.Map == map) { continue; } diff --git a/Projects/UOContent/Commands/Logging.cs b/Projects/UOContent/Commands/Logging.cs index 94f40d597..1ba8401d8 100644 --- a/Projects/UOContent/Commands/Logging.cs +++ b/Projects/UOContent/Commands/Logging.cs @@ -73,7 +73,7 @@ namespace Server.Commands var path = Core.BaseDirectory; - var name = @from.Account is not Account acct ? from.Name : acct.Username; + var name = from.Account is not Account acct ? from.Name : acct.Username; AppendPath(ref path, "Logs"); AppendPath(ref path, "Commands"); diff --git a/Projects/UOContent/Engines/ConPVP/DuelContext.cs b/Projects/UOContent/Engines/ConPVP/DuelContext.cs index b745ad9af..9e763c767 100644 --- a/Projects/UOContent/Engines/ConPVP/DuelContext.cs +++ b/Projects/UOContent/Engines/ConPVP/DuelContext.cs @@ -257,7 +257,7 @@ namespace Server.Engines.ConPVP public static bool AllowSpecialAbility(Mobile from, string name, bool message) { - if (@from is not PlayerMobile pm) + if (from is not PlayerMobile pm) { return true; } diff --git a/Projects/UOContent/Engines/Help/PageQueue.cs b/Projects/UOContent/Engines/Help/PageQueue.cs index dee5f13ad..07c4b9509 100644 --- a/Projects/UOContent/Engines/Help/PageQueue.cs +++ b/Projects/UOContent/Engines/Help/PageQueue.cs @@ -128,7 +128,7 @@ namespace Server.Engines.Help public static bool CheckAllowedToPage(Mobile from) { - if (@from is not PlayerMobile pm) + if (from is not PlayerMobile pm) { return true; } diff --git a/Projects/UOContent/Engines/ML Quests/Gumps/RaceChangeGump.cs b/Projects/UOContent/Engines/ML Quests/Gumps/RaceChangeGump.cs index b6759c71c..d5b6a0555 100644 --- a/Projects/UOContent/Engines/ML Quests/Gumps/RaceChangeGump.cs +++ b/Projects/UOContent/Engines/ML Quests/Gumps/RaceChangeGump.cs @@ -325,7 +325,7 @@ namespace Server.Engines.MLQuests.Gumps public override void OnDoubleClick(Mobile from) { - if (@from is not PlayerMobile pm) + if (from is not PlayerMobile pm) { return; } diff --git a/Projects/UOContent/Engines/ML Quests/Items/PrismaticCrystal.cs b/Projects/UOContent/Engines/ML Quests/Items/PrismaticCrystal.cs index 64978b443..430506447 100644 --- a/Projects/UOContent/Engines/ML Quests/Items/PrismaticCrystal.cs +++ b/Projects/UOContent/Engines/ML Quests/Items/PrismaticCrystal.cs @@ -22,7 +22,7 @@ namespace Server.Items public override void OnDoubleClick(Mobile from) { - if (@from is not PlayerMobile pm || pm.Backpack == null) + if (from is not PlayerMobile pm || pm.Backpack == null) { return; } diff --git a/Projects/UOContent/Engines/Quests/Dark Tides/DarkTidesQuest.cs b/Projects/UOContent/Engines/Quests/Dark Tides/DarkTidesQuest.cs index 5ce3407d6..6cbf52433 100644 --- a/Projects/UOContent/Engines/Quests/Dark Tides/DarkTidesQuest.cs +++ b/Projects/UOContent/Engines/Quests/Dark Tides/DarkTidesQuest.cs @@ -83,7 +83,7 @@ namespace Server.Engines.Quests.Necro public static bool HasLostCallingScroll(Mobile from) { - if (@from is not PlayerMobile pm) + if (from is not PlayerMobile pm) { return false; } diff --git a/Projects/UOContent/Engines/Quests/Dark Tides/Items/KronusScroll.cs b/Projects/UOContent/Engines/Quests/Dark Tides/Items/KronusScroll.cs index 8c91b6a3f..9fa4a5b48 100644 --- a/Projects/UOContent/Engines/Quests/Dark Tides/Items/KronusScroll.cs +++ b/Projects/UOContent/Engines/Quests/Dark Tides/Items/KronusScroll.cs @@ -31,7 +31,7 @@ namespace Server.Engines.Quests.Necro return; } - if (@from is not PlayerMobile pm) + if (from is not PlayerMobile pm) { return; } diff --git a/Projects/UOContent/Engines/Quests/Emino's Undertaking/EminosUndertakingQuest.cs b/Projects/UOContent/Engines/Quests/Emino's Undertaking/EminosUndertakingQuest.cs index bf03061c2..6ca8c0a1a 100644 --- a/Projects/UOContent/Engines/Quests/Emino's Undertaking/EminosUndertakingQuest.cs +++ b/Projects/UOContent/Engines/Quests/Emino's Undertaking/EminosUndertakingQuest.cs @@ -99,7 +99,7 @@ namespace Server.Engines.Quests.Ninja public static bool HasLostNoteForZoel(Mobile from) { - if (@from is not PlayerMobile pm) + if (from is not PlayerMobile pm) { return false; } @@ -119,7 +119,7 @@ namespace Server.Engines.Quests.Ninja public static bool HasLostEminosKatana(Mobile from) { - if (@from is not PlayerMobile pm) + if (from is not PlayerMobile pm) { return false; } diff --git a/Projects/UOContent/Engines/Quests/Haochi's Trials/HaochisTrialsQuest.cs b/Projects/UOContent/Engines/Quests/Haochi's Trials/HaochisTrialsQuest.cs index bc66e7b7c..778c24a1f 100644 --- a/Projects/UOContent/Engines/Quests/Haochi's Trials/HaochisTrialsQuest.cs +++ b/Projects/UOContent/Engines/Quests/Haochi's Trials/HaochisTrialsQuest.cs @@ -102,7 +102,7 @@ namespace Server.Engines.Quests.Samurai public static bool HasLostHaochisKatana(Mobile from) { - if (@from is not PlayerMobile pm) + if (from is not PlayerMobile pm) { return false; } diff --git a/Projects/UOContent/Engines/Quests/Haochi's Trials/Items/HonorCandle.cs b/Projects/UOContent/Engines/Quests/Haochi's Trials/Items/HonorCandle.cs index ce08640bb..af6cef5fa 100644 --- a/Projects/UOContent/Engines/Quests/Haochi's Trials/Items/HonorCandle.cs +++ b/Projects/UOContent/Engines/Quests/Haochi's Trials/Items/HonorCandle.cs @@ -30,7 +30,7 @@ namespace Server.Engines.Quests.Samurai if (!wasBurning && Burning) { - if (@from is not PlayerMobile player) + if (from is not PlayerMobile player) { return; } diff --git a/Projects/UOContent/Engines/Quests/Solen Matriarch/Objectives.cs b/Projects/UOContent/Engines/Quests/Solen Matriarch/Objectives.cs index dc889d0f4..6a4bf5b37 100644 --- a/Projects/UOContent/Engines/Quests/Solen Matriarch/Objectives.cs +++ b/Projects/UOContent/Engines/Quests/Solen Matriarch/Objectives.cs @@ -43,10 +43,10 @@ namespace Server.Engines.Quests.Matriarch if (redSolen) { - return @from is BlackSolenInfiltratorWarrior or BlackSolenInfiltratorQueen; + return from is BlackSolenInfiltratorWarrior or BlackSolenInfiltratorQueen; } - return @from is RedSolenInfiltratorWarrior or RedSolenInfiltratorQueen; + return from is RedSolenInfiltratorWarrior or RedSolenInfiltratorQueen; } public override void OnKill(BaseCreature creature, Container corpse) diff --git a/Projects/UOContent/Engines/Quests/Uzeraan Turmoil/Objectives.cs b/Projects/UOContent/Engines/Quests/Uzeraan Turmoil/Objectives.cs index 91d2997b4..1de4f00ab 100644 --- a/Projects/UOContent/Engines/Quests/Uzeraan Turmoil/Objectives.cs +++ b/Projects/UOContent/Engines/Quests/Uzeraan Turmoil/Objectives.cs @@ -395,7 +395,7 @@ namespace Server.Engines.Quests.Haven public override bool IgnoreYoungProtection(Mobile from) { // This restriction continues until the end of the quest - if (@from is Zombie or Skeleton && from.Map == Map.Trammel && from.X >= 3391 && from.X <= 3424 && + if (from is Zombie or Skeleton && from.Map == Map.Trammel && from.X >= 3391 && from.X <= 3424 && from.Y >= 2639 && from.Y <= 2664) // Haven graveyard { return true; diff --git a/Projects/UOContent/Engines/Quests/Uzeraan Turmoil/UzeraanTurmoilQuest.cs b/Projects/UOContent/Engines/Quests/Uzeraan Turmoil/UzeraanTurmoilQuest.cs index 28b56908f..42236d5de 100644 --- a/Projects/UOContent/Engines/Quests/Uzeraan Turmoil/UzeraanTurmoilQuest.cs +++ b/Projects/UOContent/Engines/Quests/Uzeraan Turmoil/UzeraanTurmoilQuest.cs @@ -110,7 +110,7 @@ namespace Server.Engines.Quests.Haven public static bool HasLostScrollOfPower(Mobile from) { - if (@from is not PlayerMobile pm) + if (from is not PlayerMobile pm) { return false; } @@ -130,7 +130,7 @@ namespace Server.Engines.Quests.Haven public static bool HasLostFertileDirt(Mobile from) { - if (@from is not PlayerMobile pm) + if (from is not PlayerMobile pm) { return false; } @@ -150,7 +150,7 @@ namespace Server.Engines.Quests.Haven public static bool HasLostDaemonBlood(Mobile from) { - if (@from is not PlayerMobile pm) + if (from is not PlayerMobile pm) { return false; } @@ -170,7 +170,7 @@ namespace Server.Engines.Quests.Haven public static bool HasLostDaemonBone(Mobile from) { - if (@from is not PlayerMobile pm) + if (from is not PlayerMobile pm) { return false; } diff --git a/Projects/UOContent/Gumps/Guilds/New Guild System/GuildMemberInfoGump.cs b/Projects/UOContent/Gumps/Guilds/New Guild System/GuildMemberInfoGump.cs index c5bf35787..706035ed1 100644 --- a/Projects/UOContent/Gumps/Guilds/New Guild System/GuildMemberInfoGump.cs +++ b/Projects/UOContent/Gumps/Guilds/New Guild System/GuildMemberInfoGump.cs @@ -244,7 +244,7 @@ namespace Server.Guilds public void SetTitle_Callback(Mobile from, string text) { - if (@from is not PlayerMobile pm || m_Member == null) + if (from is not PlayerMobile pm || m_Member == null) { return; } diff --git a/Projects/UOContent/Gumps/Guilds/New Guild System/OtherGuildInfo.cs b/Projects/UOContent/Gumps/Guilds/New Guild System/OtherGuildInfo.cs index b92cd52aa..761bff0d4 100644 --- a/Projects/UOContent/Gumps/Guilds/New Guild System/OtherGuildInfo.cs +++ b/Projects/UOContent/Gumps/Guilds/New Guild System/OtherGuildInfo.cs @@ -715,7 +715,7 @@ namespace Server.Guilds public void CreateAlliance_Callback(Mobile from, string text) { - if (@from is not PlayerMobile pm) + if (from is not PlayerMobile pm) { return; } diff --git a/Projects/UOContent/Items/Addons/DartBoard.cs b/Projects/UOContent/Items/Addons/DartBoard.cs index 967b27fd8..18333c337 100644 --- a/Projects/UOContent/Items/Addons/DartBoard.cs +++ b/Projects/UOContent/Items/Addons/DartBoard.cs @@ -60,7 +60,7 @@ namespace Server.Items public void Throw(Mobile from) { - if (@from.Weapon is not BaseKnife knife) + if (from.Weapon is not BaseKnife knife) { from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 500751); // Try holding a knife... return; diff --git a/Projects/UOContent/Items/Misc/Corpses/Corpse.cs b/Projects/UOContent/Items/Misc/Corpses/Corpse.cs index 766b5989e..f3ea9e7b6 100644 --- a/Projects/UOContent/Items/Misc/Corpses/Corpse.cs +++ b/Projects/UOContent/Items/Misc/Corpses/Corpse.cs @@ -1054,7 +1054,7 @@ namespace Server.Items return; } - if (@from is not PlayerMobile player) + if (from is not PlayerMobile player) { return; } diff --git a/Projects/UOContent/Items/Skill Items/Harvest Tools/BaseHarvestTool.cs b/Projects/UOContent/Items/Skill Items/Harvest Tools/BaseHarvestTool.cs index 8fffda490..66a98318f 100644 --- a/Projects/UOContent/Items/Skill Items/Harvest Tools/BaseHarvestTool.cs +++ b/Projects/UOContent/Items/Skill Items/Harvest Tools/BaseHarvestTool.cs @@ -168,7 +168,7 @@ namespace Server.Items return; } - if (@from is not PlayerMobile pm) + if (from is not PlayerMobile pm) { return; } diff --git a/Projects/UOContent/Items/Special/House Raffle/HouseRaffleStone.cs b/Projects/UOContent/Items/Special/House Raffle/HouseRaffleStone.cs index deb7f74a5..248b24751 100644 --- a/Projects/UOContent/Items/Special/House Raffle/HouseRaffleStone.cs +++ b/Projects/UOContent/Items/Special/House Raffle/HouseRaffleStone.cs @@ -299,7 +299,7 @@ namespace Server.Items private bool HasEntered(Mobile from) { - if (@from.Account is not Account acc) + if (from.Account is not Account acc) { return false; } @@ -509,7 +509,7 @@ namespace Server.Items return; } - if (@from.Account is not Account) + if (from.Account is not Account) { return; } diff --git a/Projects/UOContent/Items/Special/SoulStone.cs b/Projects/UOContent/Items/Special/SoulStone.cs index e170157f7..a951f169f 100644 --- a/Projects/UOContent/Items/Special/SoulStone.cs +++ b/Projects/UOContent/Items/Special/SoulStone.cs @@ -167,7 +167,7 @@ namespace Server.Items return false; } - if (Account != null && (@from.Account is not Accounting.Account || from.Account.Username != Account)) + if (Account != null && (from.Account is not Accounting.Account || from.Account.Username != Account)) { from.SendLocalizedMessage( 1070714 diff --git a/Projects/UOContent/Items/Wands/BaseWand.cs b/Projects/UOContent/Items/Wands/BaseWand.cs index 3e030dcd8..310ffe526 100644 --- a/Projects/UOContent/Items/Wands/BaseWand.cs +++ b/Projects/UOContent/Items/Wands/BaseWand.cs @@ -244,7 +244,7 @@ namespace Server.Items public virtual void DoWandTarget(Mobile from, object o) { - if (Deleted || _charges <= 0 || Parent != @from || o is StaticTarget or LandTarget) + if (Deleted || _charges <= 0 || Parent != from || o is StaticTarget or LandTarget) { return; } diff --git a/Projects/UOContent/Mobiles/PlayerMobile.cs b/Projects/UOContent/Mobiles/PlayerMobile.cs index 59a605d5b..3e9895002 100644 --- a/Projects/UOContent/Mobiles/PlayerMobile.cs +++ b/Projects/UOContent/Mobiles/PlayerMobile.cs @@ -1252,7 +1252,7 @@ namespace Server.Mobiles { string notice; - if (@from.Account is not Account acct || !acct.HasAccess(from.NetState)) + if (from.Account is not Account acct || !acct.HasAccess(from.NetState)) { if (from.AccessLevel == AccessLevel.Player) { diff --git a/Projects/UOContent/Mobiles/Special/BaseShieldGuard.cs b/Projects/UOContent/Mobiles/Special/BaseShieldGuard.cs index 7c1cb745c..85eaaaba4 100644 --- a/Projects/UOContent/Mobiles/Special/BaseShieldGuard.cs +++ b/Projects/UOContent/Mobiles/Special/BaseShieldGuard.cs @@ -116,7 +116,7 @@ namespace Server.Mobiles var from = e.Mobile; - if (@from.Guild is not Guild g || g.Type != Type) + if (from.Guild is not Guild g || g.Type != Type) { Say(SignupNumber); } diff --git a/Projects/UOContent/Spells/Spellweaving/ArcanistSpell.cs b/Projects/UOContent/Spells/Spellweaving/ArcanistSpell.cs index 4ebe0f2aa..bd4e75b5d 100644 --- a/Projects/UOContent/Spells/Spellweaving/ArcanistSpell.cs +++ b/Projects/UOContent/Spells/Spellweaving/ArcanistSpell.cs @@ -34,7 +34,7 @@ namespace Server.Spells.Spellweaving from.Holding as ArcaneFocus ?? from.Backpack?.FindItemByType(); public static bool CheckExpansion(Mobile from) => - @from is not PlayerMobile || from.NetState?.SupportsExpansion(Expansion.ML) == true; + from is not PlayerMobile || from.NetState?.SupportsExpansion(Expansion.ML) == true; public override bool CheckCast() {