mirror of
https://github.com/MilkBowl/Vault.git
synced 2024-11-13 06:06:28 +01:00
make sure we don't go negative for Essentials eco
This commit is contained in:
parent
d02fca42fe
commit
76d12af873
@ -103,6 +103,10 @@ public class Economy_Essentials implements Economy {
|
||||
String errorMessage = null;
|
||||
|
||||
try {
|
||||
balance = com.earth2me.essentials.api.Economy.getMoney(playerName);
|
||||
if (balance - amount < 0) {
|
||||
return new EconomyResponse(0, balance, ResponseType.FAILURE, "Not enough funds!");
|
||||
}
|
||||
com.earth2me.essentials.api.Economy.subtract(playerName, amount);
|
||||
balance = com.earth2me.essentials.api.Economy.getMoney(playerName);
|
||||
type = EconomyResponse.ResponseType.SUCCESS;
|
||||
|
Loading…
Reference in New Issue
Block a user