From ac4d349caad7e62ae9c1a3fe129f5f1d536d3695 Mon Sep 17 00:00:00 2001 From: Kamron Batman <3953314+kamronbatman@users.noreply.github.com> Date: Fri, 4 Jun 2021 23:41:43 -0700 Subject: [PATCH] fix(spells): Fixes an edge case with casters current map (#643) --- Projects/UOContent/Spells/Base/SpellHelper.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Projects/UOContent/Spells/Base/SpellHelper.cs b/Projects/UOContent/Spells/Base/SpellHelper.cs index 884ba9113..deac7860d 100644 --- a/Projects/UOContent/Spells/Base/SpellHelper.cs +++ b/Projects/UOContent/Spells/Base/SpellHelper.cs @@ -666,8 +666,8 @@ namespace Server.Spells } // Always allow monsters to teleport - if (caster is BaseCreature bc && !bc.Controlled && !bc.Summoned && - (type == TravelCheckType.TeleportTo || type == TravelCheckType.TeleportFrom)) + if (caster is BaseCreature { Controlled: false, Summoned: false } && + type is TravelCheckType.TeleportTo or TravelCheckType.TeleportFrom) { return true; } @@ -681,7 +681,7 @@ namespace Server.Spells if (caster != null) { var destination = Region.Find(loc, map) as BaseRegion; - var current = Region.Find(caster.Location, map) as BaseRegion; + var current = Region.Find(caster.Location, caster.Map) as BaseRegion; if (destination?.CheckTravel(caster, loc, type) == false || current?.CheckTravel(caster, loc, type) == false) {