From fe9dae05432c807e0bde579d899cea9b254de335 Mon Sep 17 00:00:00 2001 From: TheiLLeniumStudios <104288623+TheiLLeniumStudios@users.noreply.github.com> Date: Fri, 6 May 2022 13:56:21 +0000 Subject: [PATCH] Change back to compound operators --- server/events.lua | 8 ++++---- server/functions.lua | 4 ++-- server/player.lua | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/server/events.lua b/server/events.lua index 78d2138..acc0436 100644 --- a/server/events.lua +++ b/server/events.lua @@ -213,11 +213,11 @@ QBCore.Functions.CreateCallback('QBCore:HasItem', function(source, cb, items, am for k, v in pairs(items) do if type(k) == 'string' then finalcount = 0 - for _, _ in pairs(items) do finalcount = finalcount + 1 end + for _, _ in pairs(items) do finalcount += 1 end local item = Player.Functions.GetItemByName(k) if item then if item.amount >= v then - count = count + 1 + count += 1 if count == finalcount then retval = true end @@ -229,13 +229,13 @@ QBCore.Functions.CreateCallback('QBCore:HasItem', function(source, cb, items, am if item then if amount then if item.amount >= amount then - count = count + 1 + count += 1 if count == finalcount then retval = true end end else - count = count + 1 + count += 1 if count == finalcount then retval = true end diff --git a/server/functions.lua b/server/functions.lua index fc55cb8..7cd64e5 100644 --- a/server/functions.lua +++ b/server/functions.lua @@ -83,7 +83,7 @@ function QBCore.Functions.GetPlayersOnDuty(job) if Player.PlayerData.job.name == job then if Player.PlayerData.job.onduty then players[#players + 1] = src - count = count + 1 + count += 1 end end end @@ -96,7 +96,7 @@ function QBCore.Functions.GetDutyCount(job) for _, Player in pairs(QBCore.Players) do if Player.PlayerData.job.name == job then if Player.PlayerData.job.onduty then - count = count + 1 + count += 1 end end end diff --git a/server/player.lua b/server/player.lua index 1a6ae7f..193b0c7 100644 --- a/server/player.lua +++ b/server/player.lua @@ -577,7 +577,7 @@ function QBCore.Player.GetTotalWeight(items) local weight = 0 if not items then return 0 end for _, item in pairs(items) do - weight = weight + item.weight * item.amount + weight += item.weight * item.amount end return tonumber(weight) end