Clean up: Bugs, LINQ, constructors, default values, and null checks (#18)

This commit is contained in:
Kamron Batman 2019-03-11 14:29:59 -07:00 • committed by GitHub
parent e748af4430
commit 513e54f70e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
1094 changed files with 15913 additions and 21892 deletions

View file

@ -21,10 +21,7 @@ namespace Server.Engines.ConPVP
public override bool AllowHousing(Mobile from, Point3D p)
{
if (from.AccessLevel < AccessLevel.GameMaster)
return false;
return base.AllowHousing(from, p);
return from.AccessLevel >= AccessLevel.GameMaster && base.AllowHousing(from, p);
}
public override bool OnMoveInto(Mobile m, Direction d, Point3D newLocation, Point3D oldLocation)
@ -35,12 +32,11 @@ namespace Server.Engines.ConPVP
return false;
}
PlayerMobile pm = m as PlayerMobile;
PlayerMobile pm = m as PlayerMobile ??
(m is BaseCreature bc && bc.Summoned ?
bc.SummonMaster as PlayerMobile : null);
if (pm == null && m is BaseCreature bc && bc.Summoned)
pm = bc.SummonMaster as PlayerMobile;
if (pm?.DuelContext != null && pm.DuelContext.StartedBeginCountdown)
if (pm?.DuelContext?.StartedBeginCountdown == true)
return true;
if (DuelContext.CheckCombat(m))
@ -67,4 +63,4 @@ namespace Server.Engines.ConPVP
return false;
}
}
}
}