From d2178ca2581a40c273c3077b712a7a0c27ac6171 Mon Sep 17 00:00:00 2001 From: DokaDoka Date: Sat, 4 Jun 2022 13:49:15 +1000 Subject: [PATCH] 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 --- resource/interface/client/context.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/resource/interface/client/context.lua b/resource/interface/client/context.lua index fb16892..1de0d9a 100644 --- a/resource/interface/client/context.lua +++ b/resource/interface/client/context.lua @@ -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