mirror of
https://github.com/EssentialsX/Essentials.git
synced 2024-12-24 18:18:29 +01:00
Fix for money exploit on trade signs
This commit is contained in:
parent
8bb4067f06
commit
0ac26265e2
@ -98,9 +98,14 @@ public class SignTrade extends EssentialsSign
|
||||
if (split.length == 2 && amountNeeded)
|
||||
{
|
||||
final Double money = getMoney(split[0]);
|
||||
final Double amount = getDoublePositive(split[1]);
|
||||
Double amount = getDoublePositive(split[1]);
|
||||
if (money != null && amount != null)
|
||||
{
|
||||
amount -= amount % money;
|
||||
if (amount < 1 || money < 1)
|
||||
{
|
||||
throw new SignException(Util.i18n("moreThanZero"));
|
||||
}
|
||||
sign.setLine(index, Util.formatCurrency(money, ess) + ":" + Util.formatCurrency(amount, ess).substring(1));
|
||||
return;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user