fix(interface/context): correct id if a float is received

- the array part of a mixed options table registers a '1.0' and so on, this is not how the option is recorded on the lua side
This commit is contained in:
DokaDoka
2022-06-04 13:49:15 +10:00
parent 6d0f915b00
commit d2178ca258

View File

@@ -42,7 +42,11 @@ end)
RegisterNUICallback('clickContext', function(id, cb)
cb(1)
if tonumber(id) then id += 1 end
if math.type(tonumber(id)) == 'float' then
id = math.tointeger(id)
elseif tonumber(id) then
id += 1
end
local data = contextMenus[openContextMenu].options[id]
if not data.event and not data.serverEvent then return end
openContextMenu = nil