mirror of
https://github.com/esx-framework/esx_core.git
synced 2026-08-29 09:18:53 +00:00
Merge pull request #1253 from Kenshiin13/Underflow-Check
Prevent Integer Underflow in Account Balance Update
This commit is contained in:
@@ -310,6 +310,10 @@ function CreateExtendedPlayer(playerId, identifier, group, accounts, inventory,
|
||||
|
||||
if account then
|
||||
money = account.round and ESX.Math.Round(money) or money
|
||||
if self.accounts[account.index].money - money > self.accounts[account.index].money then
|
||||
print(('[^1ERROR^7] Tried To Underflow Account ^5%s^0 For Player ^5%s^0!'):format(accountName, self.playerId))
|
||||
return
|
||||
end
|
||||
self.accounts[account.index].money = self.accounts[account.index].money - money
|
||||
|
||||
self.triggerEvent('esx:setAccountMoney', account)
|
||||
|
||||
Reference in New Issue
Block a user