Skip to content
This repository has been archived by the owner on Jan 16, 2024. It is now read-only.

Commit

Permalink
Fix an issue regarding multiple currencies
Browse files Browse the repository at this point in the history
Closes #98 and closes #93
  • Loading branch information
Flibio committed Sep 6, 2018
1 parent f59c768 commit d5dee7a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ name=EconomyLite
owner=Flibio
inceptionYear=2015
currentYear=2018
version=2.15.0
version=2.15.1
apiVersion=7.1.0-SNAPSHOT
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,9 @@ public boolean hasBalance(Currency currency, Set<Context> contexts) {

@Override
public BigDecimal getBalance(Currency currency, Set<Context> contexts) {
if (!hasBalance(currency, contexts)) {
playerService.setBalance(uuid, getDefaultBalance(currency), currency, CauseFactory.create("New Account"));
}
return playerService.getBalance(uuid, currency, CauseFactory.create("Get Balance"));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@ public boolean hasBalance(Currency currency, Set<Context> contexts) {

@Override
public BigDecimal getBalance(Currency currency, Set<Context> contexts) {
if (!hasBalance(currency, contexts)) {
virtualService.setBalance(name, getDefaultBalance(currency), currency, CauseFactory.create("New Account"));
}
return virtualService.getBalance(name, currency, CauseFactory.create("Get Balance"));
}

Expand Down

0 comments on commit d5dee7a

Please sign in to comment.