fix: Fixes first/second scrolls crashing (#891)
* Fixes first/second circle scrolls crashing * Consolidates some resistance logic * Removes unnecessary multiple lookups for items on layer
This commit is contained in:
parent
f634ee2748
commit
171df32257
16 changed files with 39 additions and 49 deletions
|
|
@ -142,7 +142,7 @@ namespace Server.Spells.Necromancy
|
|||
return;
|
||||
}
|
||||
|
||||
if (!(item is Corpse c))
|
||||
if (item is not Corpse c)
|
||||
{
|
||||
Caster.SendLocalizedMessage(1061084); // You cannot animate that.
|
||||
}
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ namespace Server.Spells.Necromancy
|
|||
Caster.SendLocalizedMessage(1060508); // You can't curse that.
|
||||
}
|
||||
// only PlayerMobile and BaseCreature implement blood oath checking
|
||||
else if (Caster == m || !(m is PlayerMobile || m is BaseCreature))
|
||||
else if (Caster == m || m is not (PlayerMobile or BaseCreature))
|
||||
{
|
||||
Caster.SendLocalizedMessage(1060508); // You can't curse that.
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ namespace Server.Spells.Necromancy
|
|||
|
||||
public override void OnCast()
|
||||
{
|
||||
if (!(Caster.Weapon is BaseWeapon weapon) || weapon is Fists)
|
||||
if (Caster.Weapon is not BaseWeapon weapon || weapon is Fists)
|
||||
{
|
||||
Caster.SendLocalizedMessage(501078); // You must be holding a weapon.
|
||||
}
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ namespace Server.Spells.Necromancy
|
|||
|
||||
public void Target(Mobile m)
|
||||
{
|
||||
if (!(m is BaseCreature || m is PlayerMobile))
|
||||
if (m is not (BaseCreature or PlayerMobile))
|
||||
{
|
||||
Caster.SendLocalizedMessage(1060508); // You can't curse that.
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue