Clean up: Bugs, LINQ, constructors, default values, and null checks (#18)
This commit is contained in:
parent
e748af4430
commit
513e54f70e
1094 changed files with 15913 additions and 21892 deletions
|
|
@ -171,7 +171,7 @@ namespace Server.Engines.VeteranRewards
|
|||
max = 2 + level;
|
||||
}
|
||||
|
||||
public static bool CheckIsUsableBy(Mobile from, Item item, object[] args)
|
||||
public static bool CheckIsUsableBy(Mobile from, Item item, object[] args = null)
|
||||
{
|
||||
if (m_Lists == null)
|
||||
SetupRewardTables();
|
||||
|
|
@ -189,12 +189,12 @@ namespace Server.Engines.VeteranRewards
|
|||
{
|
||||
if (entries[j].ItemType != type)
|
||||
continue;
|
||||
|
||||
|
||||
if (args == null && entries[j].Args.Length == 0)
|
||||
{
|
||||
if (isRelaxedRules && i <= 0 || HasAccess(from, list, out TimeSpan ts))
|
||||
return true;
|
||||
|
||||
|
||||
from.SendLocalizedMessage(1008126, true,
|
||||
Math.Ceiling(ts.TotalDays / 30.0)
|
||||
.ToString()); // Your account is not old enough to use this item. Months until you can use this item :
|
||||
|
|
@ -204,7 +204,7 @@ namespace Server.Engines.VeteranRewards
|
|||
|
||||
if (args?.Length != entries[j].Args.Length)
|
||||
continue;
|
||||
|
||||
|
||||
bool match = true;
|
||||
|
||||
for (int k = 0; match && k < args.Length; ++k)
|
||||
|
|
@ -214,7 +214,7 @@ namespace Server.Engines.VeteranRewards
|
|||
{
|
||||
if (isRelaxedRules && i <= 0 || HasAccess(from, list, out TimeSpan ts))
|
||||
return true;
|
||||
|
||||
|
||||
from.SendLocalizedMessage(1008126, true,
|
||||
Math.Ceiling(ts.TotalDays / 30.0)
|
||||
.ToString()); // Your account is not old enough to use this item. Months until you can use this item :
|
||||
|
|
@ -503,4 +503,4 @@ namespace Server.Engines.VeteranRewards
|
|||
{
|
||||
bool IsRewardItem{ get; set; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue