Fixing INTEGER.MAX_VALUE culprit....

This commit is contained in:
Technus 2016-09-06 13:58:24 +02:00
parent 7dfb3e0da9
commit c5eeb27cd6

View file

@ -260,8 +260,8 @@ public abstract class GT_MetaBase_Item extends GT_Generic_Item implements ISpeci
if (tStats == null || tStats[2] > aTier || !(tStats[3] == -1 || tStats[3] == -3 || (tStats[3] < 0 && aCharge == Integer.MAX_VALUE)) || aStack.stackSize != 1) if (tStats == null || tStats[2] > aTier || !(tStats[3] == -1 || tStats[3] == -3 || (tStats[3] < 0 && aCharge == Integer.MAX_VALUE)) || aStack.stackSize != 1)
return 0; return 0;
//REALLY?? THIS IS THE CULPRIT THAT CHARGES ITEMS AT INSTANT!!! //REALLY?? THIS IS THE CULPRIT THAT CHARGES ITEMS AT INSTANT!!!
long tChargeBefore = getRealCharge(aStack), tNewCharge = aCharge == Integer.MAX_VALUE ? Long.MAX_VALUE : Math.min(Math.abs(tStats[0]), tChargeBefore + (aIgnoreTransferLimit ? (long) aCharge : Math.min(tStats[1], (long) aCharge))); //long tChargeBefore = getRealCharge(aStack), tNewCharge = aCharge == Integer.MAX_VALUE ? Long.MAX_VALUE : Math.min(Math.abs(tStats[0]), tChargeBefore + (aIgnoreTransferLimit ? (long) aCharge : Math.min(tStats[1], (long) aCharge)));
// long tChargeBefore = getRealCharge(aStack), tNewCharge = Math.min(Math.abs(tStats[0]), tChargeBefore + (aIgnoreTransferLimit ? (long) aCharge : Math.min(tStats[1], (long) aCharge))); long tChargeBefore = getRealCharge(aStack), tNewCharge = Math.min(Math.abs(tStats[0]), tChargeBefore + (aIgnoreTransferLimit ? (long) aCharge : Math.min(tStats[1], (long) aCharge)));
if (!aSimulate) setCharge(aStack, tNewCharge); if (!aSimulate) setCharge(aStack, tNewCharge);
return tNewCharge - tChargeBefore; return tNewCharge - tChargeBefore;
} }