Remove settings properly (#7676)

This commit is contained in:
SmallJoker 2018-09-30 19:57:31 +02:00 committed by Nils Dagsson Moskopp
parent f7c4228ac0
commit 19e83f39db
Signed by: erlehmann
GPG Key ID: A3BC671C35191080
1 changed files with 1 additions and 6 deletions

View File

@ -977,12 +977,7 @@ local function handle_settings_buttons(this, fields, tabname, tabdata)
if fields["btn_restore"] then
local setting = settings[selected_setting]
if setting and setting.type ~= "category" then
if setting.type == "noise_params_2d"
or setting.type == "noise_params_3d" then
core.settings:set_np_group(setting.name, setting.default_table)
else
core.settings:set(setting.name, setting.default)
end
core.settings:remove(setting.name)
core.settings:write()
core.update_formspec(this:get_formspec())
end