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

@ -136,7 +136,7 @@ namespace Server.Factions
{
return Definition.Sort - other.Definition.Sort;
}
public int CompareTo(object obj)
{
return Definition.Sort - ((Town)obj).Definition.Sort;
@ -386,18 +386,14 @@ namespace Server.Factions
public bool IsSheriff(Mobile mob)
{
if (mob == null || mob.Deleted)
return false;
return mob.AccessLevel >= AccessLevel.GameMaster || mob == Sheriff;
return mob?.Deleted == false &&
(mob.AccessLevel >= AccessLevel.GameMaster || mob == Sheriff);
}
public bool IsFinance(Mobile mob)
{
if (mob == null || mob.Deleted)
return false;
return mob.AccessLevel >= AccessLevel.GameMaster || mob == Finance;
return mob?.Deleted == false &&
(mob.AccessLevel >= AccessLevel.GameMaster || mob == Finance);
}
public void Capture(Faction f)
@ -511,4 +507,4 @@ namespace Server.Factions
}
}
}
}
}