Skip to content

Commit bc1d0be

Browse files
committed
fix: nil check for global table
1 parent 1a6ac6a commit bc1d0be

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

client/main.lua

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ local function getOptionsForEntity(entity, globalType)
164164
local model, netId = cachedEntityInfo(entity)
165165

166166
local options = {
167-
global = #store[globalType] > 0 and store[globalType] or nil,
167+
global = (store[globalType] ~= nil and #store[globalType] > 0 and store[globalType]) or nil,
168168
model = (store.models[model] ~= nil and #store.models[model] > 0 and store.models[model]) or nil,
169169
entity = (netId and store.entities[netId] ~= nil and #store.entities[netId] > 0 and store.entities[netId]) or nil,
170170
localEntity = (store.localEntities[entity] ~= nil and #store.localEntities[entity] > 0 and store.localEntities[entity]) or nil,
@@ -484,7 +484,6 @@ local function drawLoop()
484484
dui.sendMessage('setOptions', { options = data.validOpts, resetIndex = resetIndex })
485485
end
486486
else
487-
-- lib.print.info(item)
488487
local distance = #(playerCoords - coords)
489488
if distance < config.maxInteractDistance and item.currentScreenDistance < math.huge then
490489
local distanceRatio = math.min(0.5 + (0.25 * (distance / 10.0)), 1.0)

0 commit comments

Comments
 (0)