Skip to content

Commit

Permalink
small checks
Browse files Browse the repository at this point in the history
localize the variable first
then check whether that table exists
  • Loading branch information
pingu7867 authored Dec 21, 2023
1 parent 7950cca commit c8542c5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lua/pac3/editor/client/asset_browser.lua
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ local function install_click(icon, path, pattern, on_menu, pathid)
end
SetClipboardText(path)
end)

local resource_type = ""
if string.match(path, "^materials/(.+)%.vmt$") or string.match(path, "^materials/(.+%.png)$") then resource_type = "materials"
elseif string.match(path, "^models/") then resource_type = "models" end

Expand All @@ -161,7 +161,7 @@ local function install_click(icon, path, pattern, on_menu, pathid)
elseif not pace.bookmarked_ressources[resource_type] then
pace.SaveRessourceBookmarks()
end
if GetConVar("pac_asset_browser_extra_options"):GetBool() then
if GetConVar("pac_asset_browser_extra_options"):GetBool() and pace.bookmarked_ressources[resource_type] then
if GetConVar("pac_favorites_try_to_get_asset_series"):GetBool() then
if not table.HasValue(pace.bookmarked_ressources[resource_type], path) then
menu:AddOption(L"add series to favorites", function()
Expand Down

0 comments on commit c8542c5

Please sign in to comment.