Formatting FIxes (#58)

This commit is contained in:
Kamron Batman 2019-10-04 23:08:13 -07:00 committed by GitHub
parent 57fb9fb525
commit 096d39609e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
1318 changed files with 11633 additions and 22129 deletions

View file

@ -8,20 +8,11 @@ namespace Server
private static int[] m_Table;
public static int Lookup(Mobile m)
{
return Lookup(m.Body.BodyID, DefaultItemID);
}
public static int Lookup(Mobile m) => Lookup(m.Body.BodyID, DefaultItemID);
public static int Lookup(int body)
{
return Lookup(body, DefaultItemID);
}
public static int Lookup(int body) => Lookup(body, DefaultItemID);
public static int Lookup(Mobile m, int defaultValue)
{
return Lookup(m.Body.BodyID, defaultValue);
}
public static int Lookup(Mobile m, int defaultValue) => Lookup(m.Body.BodyID, defaultValue);
public static int Lookup(int body, int defaultValue)
{
@ -51,35 +42,33 @@ namespace Server
m_Table = new int[1000];
using (StreamReader ip = new StreamReader(path))
using StreamReader ip = new StreamReader(path);
string line;
while ((line = ip.ReadLine()) != null)
{
string line;
line = line.Trim();
while ((line = ip.ReadLine()) != null)
if (line.Length == 0 || line.StartsWith("#"))
continue;
try
{
line = line.Trim();
string[] split = line.Split('\t');
if (line.Length == 0 || line.StartsWith("#"))
continue;
try
if (split.Length >= 2)
{
string[] split = line.Split('\t');
int body = Utility.ToInt32(split[0]);
int item = Utility.ToInt32(split[1]);
if (split.Length >= 2)
{
int body = Utility.ToInt32(split[0]);
int item = Utility.ToInt32(split[1]);
if (body >= 0 && body < m_Table.Length)
m_Table[body] = item;
}
}
catch
{
// ignored
if (body >= 0 && body < m_Table.Length)
m_Table[body] = item;
}
}
catch
{
// ignored
}
}
}
}