Formatting #2 (#59)

This commit is contained in:
Kamron Batman 2019-10-05 00:37:03 -07:00 committed by GitHub
parent 096d39609e
commit 8e9221bb5a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
400 changed files with 3688 additions and 5969 deletions

View file

@ -69,7 +69,6 @@ namespace Server.Regions
List<SpawnEntry> list = new List<SpawnEntry>();
foreach (XmlNode node in spawning.ChildNodes)
{
if (node is XmlElement el)
{
SpawnDefinition def = SpawnDefinition.GetSpawnDefinition(el);
@ -104,7 +103,6 @@ namespace Server.Regions
maxSpawnTime);
list.Add(entry);
}
}
if (list.Count > 0) m_Spawns = list.ToArray();
}

View file

@ -2,7 +2,6 @@ using System;
using System.Collections.Generic;
using System.Linq;
using System.Xml;
using Server.Commands;
using Server.Mobiles;
namespace Server.Regions

View file

@ -302,7 +302,6 @@ namespace Server.Regions
List<SpawnGroupElement> list = new List<SpawnGroupElement>();
foreach (XmlNode node in xmlDef.ChildNodes)
{
if (node is XmlElement el)
{
SpawnDefinition def = GetSpawnDefinition(el);
@ -315,7 +314,6 @@ namespace Server.Regions
SpawnGroupElement groupElement = new SpawnGroupElement(def, weight);
list.Add(groupElement);
}
}
SpawnGroupElement[] elements = list.ToArray();
SpawnGroup group = new SpawnGroup(name, elements);
@ -324,7 +322,7 @@ namespace Server.Regions
}
catch (Exception ex)
{
Console.WriteLine("Could not load SpawnDefinitions.xml: " + ex.Message);
Console.WriteLine($"Could not load SpawnDefinitions.xml: {ex.Message}");
}
}

View file

@ -1,6 +1,5 @@
using System;
using System.Collections.Generic;
using Server.Commands;
using Server.Mobiles;
namespace Server.Regions
@ -174,7 +173,7 @@ namespace Server.Regions
{
spawnable.Spawner = null;
bool uncontrolled = !(spawnable is BaseCreature) || !((BaseCreature)spawnable).Controlled;
bool uncontrolled = (spawnable as BaseCreature)?.Controlled != true;
if (uncontrolled)
spawnable.Delete();
@ -234,10 +233,8 @@ namespace Server.Regions
int count = reader.ReadInt();
for (int i = 0; i < count; i++)
{
if (World.FindEntity(reader.ReadUInt()) is ISpawnable spawnableEntity)
Add(spawnableEntity);
}
Running = reader.ReadBool();