mirror of
https://github.com/CommunityOx/ox_lib.git
synced 2026-08-19 16:06:02 +01:00
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:
@@ -42,7 +42,11 @@ end)
|
|||||||
|
|
||||||
RegisterNUICallback('clickContext', function(id, cb)
|
RegisterNUICallback('clickContext', function(id, cb)
|
||||||
cb(1)
|
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]
|
local data = contextMenus[openContextMenu].options[id]
|
||||||
if not data.event and not data.serverEvent then return end
|
if not data.event and not data.serverEvent then return end
|
||||||
openContextMenu = nil
|
openContextMenu = nil
|
||||||
|
|||||||
Reference in New Issue
Block a user