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,7 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using Server.Engines.Quests.Haven;
using Server.Engines.Quests.Necro;
using Server.Items;
@ -429,7 +430,7 @@ namespace Server.Commands
int indexOf = m_Params[i].IndexOf('=');
if (indexOf >= 0)
sp.AddEntry(m_Params[i].Substring(++indexOf), 100, 1);
sp.AddEntry(m_Params[i].Substring(++indexOf));
}
else if (m_Params[i].StartsWith("MinDelay"))
{
@ -901,12 +902,11 @@ namespace Server.Commands
{
eable = map.GetItemsInRange(new Point3D(x, y, z), 0);
foreach (Item item in eable)
if (item.Z == z && item.ItemID == itemID)
{
eable.Free();
return true;
}
if (eable.Any(item => item.Z == z && item.ItemID == itemID))
{
eable.Free();
return true;
}
}
eable.Free();
@ -989,7 +989,7 @@ namespace Server.Commands
{
List<DecorationList> list = new List<DecorationList>();
DecorationList v;
while ((v = Read(ip)) != null)
list.Add(v);
@ -1066,11 +1066,9 @@ namespace Server.Commands
{
public DecorationEntry(string line)
{
string x, y, z;
Pop(out x, ref line);
Pop(out y, ref line);
Pop(out z, ref line);
Pop(out string x, ref line);
Pop(out string y, ref line);
Pop(out string z, ref line);
Location = new Point3D(Utility.ToInt32(x), Utility.ToInt32(y), Utility.ToInt32(z));
Extra = line;
@ -1096,4 +1094,4 @@ namespace Server.Commands
}
}
}
}
}