Code cleanup (#195)

This commit is contained in:
Kamron Batman 2020-08-16 21:46:54 -07:00 • committed by GitHub
parent b476bcfd24
commit 0926b5abaa
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
86 changed files with 740 additions and 1635 deletions

View file

@ -95,12 +95,7 @@ namespace Server.Engines.VeteranRewards
{
TimeSpan totalTime = DateTime.UtcNow - acct.Created;
int level = (int)(totalTime.TotalDays / RewardInterval.TotalDays);
if (level < 0)
level = 0;
return level;
return Math.Max((int)(totalTime.TotalDays / RewardInterval.TotalDays), 0);
}
public static bool HasHalfLevel(Mobile mob)
@ -473,10 +468,7 @@ namespace Server.Engines.VeteranRewards
if (m.SkillsCap == 7000 || m.SkillsCap == 7050 || m.SkillsCap == 7100 ||
m.SkillsCap == 7150 || m.SkillsCap == 7200)
{
if (level > 4)
level = 4;
else if (level < 0)
level = 0;
level = Math.Clamp(level, 0, 4);
if (SkillCapRewards)
m.SkillsCap = 7000 + level * 50;