Skip to content

Commit

Permalink
fix(client/utils): properly check item count
Browse files Browse the repository at this point in the history
don't let anyone fool you into thinking i am a smart man
  • Loading branch information
thelindat committed Feb 22, 2023
1 parent 4bf5908 commit 96d65b8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions client/utils.lua
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ function PlayerHasItems(filter, hasAny)
local _type = type(filter)

if _type == 'string' then
return playerItems[filter] and true
return (playerItems[filter] or 0) > 0
elseif _type == 'table' then
local tabletype = table.type(filter)

Expand All @@ -137,7 +137,7 @@ function PlayerHasItems(filter, hasAny)
end
elseif tabletype == 'array' then
for i = 1, #filter do
local hasItem = playerItems[filter[i]]
local hasItem = (playerItems[filter[i]] or 0) > 0

if hasAny then
if hasItem then return true end
Expand Down

0 comments on commit 96d65b8

Please sign in to comment.