Skip to content

Commit

Permalink
Fix ability to int overflow when adding to LP network (#64)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ruling-0 authored Jan 17, 2025
1 parent 84e41cc commit 38f2dbb
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ public static int addCurrentEssenceToMaximum(String ownerName, int addedEssence,
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;
}
Expand Down

0 comments on commit 38f2dbb

Please sign in to comment.