Skip to content

Fix deposits rejected when account has negative balance#6515

Open
JRoy wants to merge 1 commit intoEssentialsX:2.xfrom
JRoy:fix/5606-negative-deposit
Open

Fix deposits rejected when account has negative balance#6515
JRoy wants to merge 1 commit intoEssentialsX:2.xfrom
JRoy:fix/5606-negative-deposit

Conversation

@JRoy
Copy link
Copy Markdown
Member

@JRoy JRoy commented Apr 12, 2026

Economy.add() delegated to setMoney() which checks minMoney and loan
permission against the resulting balance. Both checks reject negative
results even when the balance is improving from a deposit. Since
deposits can only move the balance upward, route them directly to
user.setMoney() bypassing the floor/loan checks. Withdrawals still
go through setMoney() with full validation.

Fixes #5606

Economy.add() delegated to setMoney() which checks minMoney and loan
permission against the resulting balance. Both checks reject negative
results even when the balance is improving from a deposit. Since
deposits can only move the balance upward, route them directly to
user.setMoney() bypassing the floor/loan checks. Withdrawals still
go through setMoney() with full validation.

Fixes EssentialsX#5606
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

When Tax account is negative essentials denies payments to it EssentialsX Economy: FAILURE - Loan was not permitted!

1 participant