Fixed vitality not decreasing if you had items with negative consumption rate.
Contributed by facab.
This commit is contained in:
		@@ -547,15 +547,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)
 | 
			
		||||
 
 | 
			
		||||
@@ -549,15 +549,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)
 | 
			
		||||
 
 | 
			
		||||
@@ -549,15 +549,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)
 | 
			
		||||
 
 | 
			
		||||
@@ -544,15 +544,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)
 | 
			
		||||
 
 | 
			
		||||
@@ -550,15 +550,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)
 | 
			
		||||
 
 | 
			
		||||
@@ -550,15 +550,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)
 | 
			
		||||
 
 | 
			
		||||
@@ -550,15 +550,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)
 | 
			
		||||
 
 | 
			
		||||
@@ -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)
 | 
			
		||||
 
 | 
			
		||||
@@ -544,15 +544,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)
 | 
			
		||||
 
 | 
			
		||||
@@ -544,15 +544,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)
 | 
			
		||||
 
 | 
			
		||||
@@ -544,15 +544,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)
 | 
			
		||||
 
 | 
			
		||||
@@ -545,15 +545,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)
 | 
			
		||||
 
 | 
			
		||||
@@ -545,15 +545,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)
 | 
			
		||||
 
 | 
			
		||||
@@ -543,15 +543,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)
 | 
			
		||||
 
 | 
			
		||||
@@ -544,15 +544,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)
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user