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

Commit

Permalink
Fix code, add final variables where needed.
Browse files Browse the repository at this point in the history
  • Loading branch information
creatorfromhell committed Dec 15, 2021
1 parent 95559a6 commit d809c48
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions TNE/src/net/tnemc/core/common/currency/type/MixedType.java
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,12 @@ public void setHoldings(UUID account, String world, TNECurrency currency, BigDec
if(holdings.compareTo(BigDecimal.ZERO) != 0 && holdings.compareTo(amount) > 0) {
final BigDecimal virtualHoldings = virtualHoldings(account, world, currency);

BigDecimal toSet = amount;
final boolean itemNeeded = (virtualHoldings.compareTo(amount) < 0);

if(virtualHoldings.compareTo(amount) < 0) {
final BigDecimal remaining = amount.subtract(virtualHoldings);
final BigDecimal toSet = (itemNeeded)? BigDecimal.ZERO : amount;

toSet = BigDecimal.ZERO;
if(itemNeeded) {
final BigDecimal remaining = amount.subtract(virtualHoldings);

setItemHoldings(account, world, currency, itemHoldings(account, world, currency, false).subtract(remaining));
}
Expand Down

0 comments on commit d809c48

Please sign in to comment.