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

@ -1,6 +1,6 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
namespace Server.Mobiles
{
@ -62,19 +62,13 @@ namespace Server.Mobiles
private void Flare()
{
Mobile caster = ControlMaster;
if (caster == null)
caster = SummonMaster;
Mobile caster = ControlMaster ?? SummonMaster;
if (caster == null)
return;
List<Mobile> list = new List<Mobile>();
foreach (Mobile m in GetMobilesInRange(5))
if (m.Player && m.Alive && !m.IsDeadBondedPet && m.Karma <= 0 && m.AccessLevel < AccessLevel.Counselor)
list.Add(m);
List<Mobile> list = GetMobilesInRange(5).Where(m =>
m.Player && m.Alive && !m.IsDeadBondedPet && m.Karma <= 0 && m.AccessLevel < AccessLevel.Counselor).ToList();
for (int i = 0; i < list.Count; ++i)
{
@ -109,4 +103,4 @@ namespace Server.Mobiles
int version = reader.ReadInt();
}
}
}
}