if we return 0 here then a lot of unrelated problems will be caused, so this is the easiest fix as this scenario is highly unlikely anyway

This commit is contained in:
Ellpeck 2018-12-02 23:34:37 +01:00
parent c571c95fec
commit 031bf3fbc3

View file

@ -59,7 +59,7 @@ public class AuraChunk implements IAuraChunk {
MutableInt spot = this.getActualDrainSpot(pos, true);
int curr = spot.intValue();
if (curr < 0 && curr - amount > 0) // Underflow protection
return 0;
return amount;
if (aimForZero) {
if (curr > 0 && curr - amount < 0)
amount = curr;
@ -83,7 +83,7 @@ public class AuraChunk implements IAuraChunk {
MutableInt spot = this.getActualDrainSpot(pos, true);
int curr = spot.intValue();
if (curr > 0 && curr + amount < 0) // Overflow protection
return 0;
return amount;
if (aimForZero) {
if (curr < 0 && curr + amount > 0) {
amount = -curr;