parent
096d39609e
commit
8e9221bb5a
400 changed files with 3688 additions and 5969 deletions
|
|
@ -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();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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}");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue