Fix ability to int overflow when adding to LP network (#64)

This commit is contained in:
Ruling-0 authored and GitHub committed 2025-01-17 05:37:09 +00:00
1 parent 84e41cc920
commit 38f2dbb395
1 file changed
+1 -1
@@ -280,7 +280,7 @@ public class SoulNetworkHandler {
return 0;
}
int newEss = Math.min(event.maximum, currEss + event.addedAmount);
int newEss = (int) Math.min(Integer.MAX_VALUE, Math.min(event.maximum, (long) currEss + event.addedAmount));
if (event.getResult() != Event.Result.DENY) {
data.currentEssence = newEss;
}