mirror of
https://github.com/Expand-sys/CCash
synced 2026-03-22 12:37:08 +11:00
🐛 fixed
This commit is contained in:
parent
779ab90b8f
commit
8fea062a3f
1 changed files with 3 additions and 3 deletions
|
|
@ -191,7 +191,7 @@ BankResponse Bank::SetBal(const std::string &name, int64_t amount) noexcept
|
|||
amount -= u.balance;
|
||||
u.balance += amount;
|
||||
#if MAX_LOG_SIZE > 0
|
||||
u.log.AddTrans("Ω", (amount > 0), amount, time(NULL));
|
||||
u.log.AddTrans("Ω", (amount > 0), std::abs(amount), time(NULL));
|
||||
#endif
|
||||
}))
|
||||
{
|
||||
|
|
@ -211,10 +211,10 @@ BankResponse Bank::ImpactBal(const std::string &name, int64_t amount) noexcept
|
|||
}
|
||||
uint32_t bal;
|
||||
if (ValidUsername(name) && Bank::users.modify_if(name, [&bal, &amount](User &u) {
|
||||
amount += (u.balance < (amount * -1)) * (amount + u.balance);
|
||||
if (u.balance < (amount * -1)) { amount = -u.balance; };
|
||||
bal = u.balance += amount;
|
||||
#if MAX_LOG_SIZE > 0
|
||||
u.log.AddTrans("Ω", (amount > 0), amount, time(NULL));
|
||||
u.log.AddTrans("Ω", (amount > 0), std::abs(amount), time(NULL));
|
||||
#endif
|
||||
}))
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in a new issue