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

(cherry picked from commit 38f2dbb395)
This commit is contained in:
Ruling-0 authored and Martin Robertz committed 2025-02-23 17:34:39 +01:00
1 parent 813a05a5a6
commit 61c66490c6
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;
}