фикс дюпа алмазов в служебном апи)

This commit is contained in:
celestora 2022-11-14 16:22:23 +02:00 committed by GitHub
parent 0a4b7225ea
commit 3c632f3910
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 0 deletions

View file

@ -54,6 +54,11 @@ class Apps implements Handler
$reject("No application with this id found"); $reject("No application with this id found");
return; return;
} }
if($amount < 0) {
$reject(552, "Payment amount is invalid");
return;
}
$coinsLeft = $this->user->getCoins() - $amount; $coinsLeft = $this->user->getCoins() - $amount;
if($coinsLeft < 0) { if($coinsLeft < 0) {

View file

@ -142,6 +142,8 @@ function handlePayment(event) {
ok: false, ok: false,
error: "negative sum" error: "negative sum"
}, '*'); }, '*');
return;
} }
MessageBox( MessageBox(