Skip to content

Commit

Permalink
fix(es_extended/client/functions): validate model is a vehicle
Browse files Browse the repository at this point in the history
  • Loading branch information
Mycroft-Studios committed Dec 4, 2024
1 parent 803508b commit 1b8774f
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions [core]/es_extended/client/functions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,7 @@ function ESX.UI.Menu.Close(menuType, namespace, name, cancel)
else
local menu = ESX.UI.Menu.Opened[i]
ESX.UI.Menu.RegisteredTypes[menu.type].close(menu.namespace, menu.name)

if type(menu.cancel) ~= "nil" then
menu.cancel(menu.data, menu)
end
Expand All @@ -412,7 +412,7 @@ function ESX.UI.Menu.CloseAll(cancel)
else
local menu = ESX.UI.Menu.Opened[i]
ESX.UI.Menu.RegisteredTypes[menu.type].close(menu.namespace, menu.name)

if type(menu.cancel) ~= "nil" then
menu.cancel(menu.data, menu)
end
Expand Down Expand Up @@ -1585,6 +1585,11 @@ function ESX.GetVehicleTypeClient(model)
if not IsModelInCdimage(model) then
return false
end

if not IsModelAVehicle(model) then
return false
end

if mismatchedTypes[model] then
return mismatchedTypes[model]
end
Expand Down

0 comments on commit 1b8774f

Please sign in to comment.