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

@ -86,13 +86,9 @@ namespace Server.Engines.ConPVP
[PropertyObject]
public class ArenaStartPoints
{
public ArenaStartPoints() : this(new Point3D[8])
public ArenaStartPoints(Point3D[] points = null)
{
}
public ArenaStartPoints(Point3D[] points)
{
Points = points;
Points = points ?? new Point3D[8];
}
public ArenaStartPoints(GenericReader reader)
@ -407,7 +403,8 @@ namespace Server.Engines.ConPVP
set
{
m_GateOut = value;
if (Teleporter != null) Teleporter.Location = m_GateOut;
if (Teleporter != null)
Teleporter.Location = m_GateOut;
}
}
@ -664,7 +661,7 @@ namespace Server.Engines.ConPVP
{
ArenaController controller = allControllers[i];
if (controller != null && !controller.Deleted && controller.Arena != null && controller.IsPrivate &&
if (controller?.Deleted == false && controller.Arena != null && controller.IsPrivate &&
controller.Map == first.Map && first.InRange(controller, 24))
{
BaseHouse house = BaseHouse.FindHouseAt(controller);
@ -832,4 +829,4 @@ namespace Server.Engines.ConPVP
#endregion
}
}
}