Remove selected_idxs for settings after saving

This commit is contained in:
Athozus 2024-01-01 19:19:51 +01:00
parent 8d80e4c709
commit 3eafeb4cf8
No known key found for this signature in database
GPG Key ID: B50895022E8484BF

View File

@ -156,6 +156,7 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
-- save settings
for setting, _ in pairs(mail.settings) do
local new_value = mail.selected_idxs[setting][playername]
mail.selected_idxs[setting][playername] = nil
if new_value == nil then new_value = mail.get_setting(playername, setting) end
mail.set_setting(playername, setting, new_value)
end