Fix error when enabling texture packs (#13829)

This commit is contained in:
Gregor Parzefall 2023-09-23 18:20:23 +02:00 committed by GitHub
parent c247761213
commit 4cf900c779
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -18,11 +18,7 @@
local packages_raw, packages local packages_raw, packages
local function on_change(type) local function update_packages()
if type ~= "ENTER" then
return
end
if not pkgmgr.global_mods then if not pkgmgr.global_mods then
pkgmgr.refresh_globals() pkgmgr.refresh_globals()
end end
@ -48,7 +44,17 @@ local function on_change(type)
is_equal, nil, {}) is_equal, nil, {})
end end
local function on_change(type)
if type == "ENTER" then
update_packages()
end
end
local function get_formspec(tabview, name, tabdata) local function get_formspec(tabview, name, tabdata)
if not packages then
update_packages()
end
if not tabdata.selected_pkg then if not tabdata.selected_pkg then
tabdata.selected_pkg = 1 tabdata.selected_pkg = 1
end end