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

@ -2,6 +2,7 @@ using System;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using Server.Engines.Quests.Haven;
using Server.Engines.Quests.Necro;
using Server.Items;
@ -427,7 +428,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"))
{
@ -899,12 +900,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();
@ -1064,11 +1064,9 @@ namespace Server.Commands
{
public DecorationEntryMag(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;
@ -1094,4 +1092,4 @@ namespace Server.Commands
}
}
}
}
}