1
0
mirror of https://github.com/Zrips/Jobs.git synced 2024-12-01 15:03:36 +01:00

Don't go from negative to positive or vise versa when applying bonus.

This commit is contained in:
Zrips 2018-03-14 15:17:16 +02:00
parent 4ed48da227
commit 1405b5f149

View File

@ -44,7 +44,10 @@ public class Boost {
}
public double getFinalAmount(CurrencyType BT, double income) {
return income + ((income > 0D ? income : -income) * getFinal(BT, false, false));
double f = income + ((income > 0D ? income : -income) * getFinal(BT, false, false));
if (income > 0 && f < 0 || income < 0 && f > 0)
f = 0;
return f;
}
public double getFinal(CurrencyType BT, boolean percent, boolean excludeExtra) {