Fixed vitality not decreasing if you had items with negative consumption rate.

Contributed by facab.
This commit is contained in:
MobiusDevelopment
2020-05-07 11:01:52 +00:00
parent 31ae41bb48
commit b07848fb1e
15 changed files with 45 additions and 90 deletions

View File

@@ -548,15 +548,12 @@ public class PlayerStat extends PlayableStat
if (points < 0) // vitality consumed
{
final int stat = (int) getValue(Stat.VITALITY_CONSUME_RATE, 1);
if (stat == 0)
double consumeRate = getValue(Stat.VITALITY_CONSUME_RATE, 1);
if (consumeRate <= 0)
{
return;
}
if (stat < 0)
{
points = -points;
}
points *= consumeRate;
}
if (points > 0)