mirror of
https://github.com/AppleDash/SaneEconomy.git
synced 2024-11-25 19:45:48 +01:00
Fix bug where some plugins may see players with an infinite balance.
This commit is contained in:
parent
770536e514
commit
5158689a2a
@ -6,10 +6,10 @@
|
||||
<parent>
|
||||
<groupId>org.appledash</groupId>
|
||||
<artifactId>SaneEconomy</artifactId>
|
||||
<version>0.6.1-SNAPSHOT</version>
|
||||
<version>0.6.2-SNAPSHOT</version>
|
||||
</parent>
|
||||
<artifactId>SaneEconomyCore</artifactId>
|
||||
<version>0.6.1-SNAPSHOT</version>
|
||||
<version>0.6.2-SNAPSHOT</version>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
|
@ -141,11 +141,19 @@ public class EconomySaneEconomy implements Economy {
|
||||
economable = Economable.wrap(playerName);
|
||||
}
|
||||
|
||||
if (!has(playerName, v)) {
|
||||
return new EconomyResponse(v, getBalance(playerName), EconomyResponse.ResponseType.FAILURE, "Insufficient funds.");
|
||||
}
|
||||
|
||||
return new EconomyResponse(v, SaneEconomy.getInstance().getEconomyManager().subtractBalance(economable, v), EconomyResponse.ResponseType.SUCCESS, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public EconomyResponse withdrawPlayer(OfflinePlayer offlinePlayer, double v) {
|
||||
if (!has(offlinePlayer, v)) {
|
||||
return new EconomyResponse(v, getBalance(offlinePlayer), EconomyResponse.ResponseType.FAILURE, "Insufficient funds.");
|
||||
}
|
||||
|
||||
return new EconomyResponse(v, SaneEconomy.getInstance().getEconomyManager().subtractBalance(Economable.wrap(offlinePlayer), v), EconomyResponse.ResponseType.SUCCESS, null);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user