Skip to content

Commit

Permalink
fix: cause check should return true on granting (#397)
Browse files Browse the repository at this point in the history
  • Loading branch information
Tomut0 committed Aug 3, 2023
1 parent e12ee8a commit f29bc74
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -267,8 +267,10 @@ public boolean grantPlayer(OfflinePlayer player, double money) {
*/
public boolean grantPlayer(@NotNull OfflinePlayer player, double money, @Nullable Cause cause) {
EconomyResponse response = Objects.requireNonNull(economy, "Can't find economy provider").depositPlayer(player, money);
if (!response.transactionSuccess() || cause == null) {
if (!response.transactionSuccess()) {
return false;
} else if (cause == null) {
return true;
}

EconomyTransactionEvent event = new EconomyTransactionEvent(player, response.amount, cause, EconomyTransactionEvent.TransactionType.DEPOSIT);
Expand Down

0 comments on commit f29bc74

Please sign in to comment.