Realizedd / Duels

A duel plugin for minecraft.
https://www.spigotmc.org/resources/duels.20171/
GNU General Public License v3.0
108 stars 100 forks source link

Integer overflow when wager gets payed out #107

Open CdeJong opened 1 year ago

CdeJong commented 1 year ago

When using betting amounts higher than half of the (positive) integer limit, the payout amount will overflow to a negative number.

In this example 1,500,000,000.00 was used as wager: afbeelding

An easy fix would be changing all integers in the plugin to doubles, as this is what vault is using and they have a much higher maximum value. As an extra precaution, I would add a configurable maximum betting amount.