Fixes chaos damage bug with the spell system. Fixes various small other bugs. Fixes more merge cast type checks and uses default values.

This commit is contained in:
Kamron Batman 2018-09-16 21:04:36 -07:00
parent 9542c79ea4
commit c155c82325
115 changed files with 644 additions and 1041 deletions

View file

@ -28,9 +28,7 @@ namespace Server.SkillHandlers
if (reg == null || reg.IsDisabled())
return true; // not in town? we can snoop any npc
BaseCreature cret = to as BaseCreature;
if (to.Body.IsHuman && (cret == null || !cret.AlwaysAttackable && !cret.AlwaysMurderer))
if (to.Body.IsHuman && (!(to is BaseCreature cret) || !cret.AlwaysAttackable && !cret.AlwaysMurderer))
return false; // in town we cannot snoop blue human npcs
return true;
@ -81,7 +79,7 @@ namespace Server.SkillHandlers
if (from.AccessLevel > AccessLevel.Player || from.CheckTargetSkill(SkillName.Snooping, cont, 0.0, 100.0))
{
if (cont is TrappableContainer && ((TrappableContainer)cont).ExecuteTrap(from))
if (cont is TrappableContainer container && container.ExecuteTrap(from))
return;
cont.DisplayTo(from);