Changes to new Gold Ledger system (#3)

Changes new gold system to use separate gold/platinum with DivRem instead of relying on doubles.
This commit is contained in:
Kamron Batman 2018-02-20 22:47:16 -08:00 committed by GitHub
parent 1030bb7675
commit d8ed7c1da9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 68 additions and 438 deletions

View file

@ -344,10 +344,10 @@ namespace Server
}
else
{
var cur = User.Account.TotalCurrency;
var off = _Plat + (_Gold / Math.Max(1.0, AccountGold.CurrencyThreshold));
int totalPlat = User.Account.TotalPlat;
int totalGold = User.Account.TotalGold;
if (off > cur)
if (totalPlat < _Plat || totalGold < _Gold)
{
_Plat = User.Account.TotalPlat;
_Gold = User.Account.TotalGold;
@ -392,4 +392,4 @@ namespace Server
}
}
}
}
}