瀏覽代碼

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.
tags/v1.1.0
Fen Dweller 5 年之前
父節點
當前提交
184e3c4d57
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. +1
    -1
      game.js

+ 1
- 1
game.js 查看文件

@@ -4850,7 +4850,7 @@ function recurseDeletePanel(settings, panel) {
recurseDeletePanel(settings, option); recurseDeletePanel(settings, option);
} else if (settings[option.id] == undefined) { } else if (settings[option.id] == undefined) {
delete settings[option.id]; 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]; delete settings[option.id];
} else if (settings[option.id] == option.default && option.id != "name") { } else if (settings[option.id] == option.default && option.id != "name") {
delete settings[option.id]; delete settings[option.id];


Loading…
取消
儲存