Code Cleanup & Fixes Warnings (#74)

This commit is contained in:
Kamron Batman 2020-01-18 14:56:45 -08:00 committed by GitHub
parent e11d1f3ad9
commit 57b14ad690
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
143 changed files with 2960 additions and 3427 deletions

View file

@ -604,7 +604,7 @@ namespace Server.Spells
// Always allow monsters to teleport
if (caster is BaseCreature bc && !bc.Controlled && !bc.Summoned && (type == TravelCheckType.TeleportTo || type == TravelCheckType.TeleportFrom))
return true;
return true;
m_TravelCaster = caster;
m_TravelType = type;
@ -794,12 +794,9 @@ namespace Server.Spells
#region Dueling
if (Region.Find(loc, map).GetRegion<SafeZone>() != null)
{
PlayerMobile pm = caster as PlayerMobile;
if (pm.DuelContext?.Started != true || pm.DuelPlayer?.Eliminated != false)
if (caster is PlayerMobile pm && (pm.DuelContext?.Started != true || pm.DuelPlayer?.Eliminated != false))
return true;
}
#endregion
GuardedRegion reg = Region.Find(loc, map).GetRegion<GuardedRegion>();