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
|
|
@ -24,7 +24,7 @@ namespace Server.Spells.Third
|
|||
|
||||
public void Target(Item item)
|
||||
{
|
||||
if (!(item is LockableContainer cont))
|
||||
if (item is not LockableContainer cont)
|
||||
{
|
||||
Caster.SendLocalizedMessage(501762); // Target must be an unlocked chest.
|
||||
}
|
||||
|
|
|
|||
|
|
@ -98,8 +98,8 @@ namespace Server.Spells.Third
|
|||
|
||||
foreach (var item in eable)
|
||||
{
|
||||
if (item is ParalyzeFieldSpell.InternalItem || item is PoisonFieldSpell.InternalItem ||
|
||||
item is FireFieldSpell.FireFieldItem)
|
||||
if (item is ParalyzeFieldSpell.InternalItem or
|
||||
PoisonFieldSpell.InternalItem or FireFieldSpell.FireFieldItem)
|
||||
{
|
||||
item.OnMoveOver(m);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ namespace Server.Spells.Third
|
|||
{
|
||||
Caster.LocalOverheadMessage(MessageType.Regular, 0x3B2, 503101); // That did not need to be unlocked.
|
||||
}
|
||||
else if (!(p is LockableContainer cont))
|
||||
else if (p is not LockableContainer cont)
|
||||
{
|
||||
Caster.SendLocalizedMessage(501666); // You can't unlock that!
|
||||
}
|
||||
|
|
|
|||
|
|
@ -149,7 +149,7 @@ namespace Server.Spells.Third
|
|||
if (m is PlayerMobile)
|
||||
{
|
||||
var noto = Notoriety.Compute(m_Caster, m);
|
||||
if (noto == Notoriety.Enemy || noto == Notoriety.Ally)
|
||||
if (noto is Notoriety.Enemy or Notoriety.Ally)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue