From 184e3c4d5792c30aed206ecce0602fc19a3fad86 Mon Sep 17 00:00:00 2001 From: Fen Dweller Date: Wed, 18 Dec 2019 13:16:03 -0500 Subject: [PATCH] Fix failure to export checkboxes that default to true This was because the game threw out all false settings when exporting - in the past, every checkbox defaulted to false. This was done because many checkboxes lack default settings of false, meaning their defualt value was undefined, not false. The code now checks for this case - false setting, undefined default - before moving on to the more general check for equivalence. --- game.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/game.js b/game.js index d8d18b9..956debb 100644 --- a/game.js +++ b/game.js @@ -4850,7 +4850,7 @@ function recurseDeletePanel(settings, panel) { recurseDeletePanel(settings, option); } else if (settings[option.id] == undefined) { delete settings[option.id]; - } else if (option.type == "checkbox" && !settings[option.id]) { + } else if (option.type == "checkbox" && !settings[option.id] && option.default === undefined) { delete settings[option.id]; } else if (settings[option.id] == option.default && option.id != "name") { delete settings[option.id];