diff --git a/system/scripts/actors/twenty-questions-dialog.js b/system/scripts/actors/twenty-questions-dialog.js index 2a4f7a9..4b5aeee 100644 --- a/system/scripts/actors/twenty-questions-dialog.js +++ b/system/scripts/actors/twenty-questions-dialog.js @@ -164,7 +164,7 @@ export class TwentyQuestionsDialog extends FormApplication { this._addOwnedItem(item, stepKey); // TODO specific event (no added honor if tech selected etc) - console.log(this.object.data, this.cache); + // console.log(this.object.data, this.cache); this.render(false); } catch (err) { @@ -237,7 +237,10 @@ export class TwentyQuestionsDialog extends FormApplication { */ _addOwnedItem(item, stepName) { // Add to Step (uniq id only) - const step = getProperty(this.object.data, stepName); + let step = getProperty(this.object.data, stepName); + if (!step) { + step = []; + } if (step.some((e) => e === item.id)) { return; } diff --git a/system/scripts/actors/twenty-questions.js b/system/scripts/actors/twenty-questions.js index 059f1e8..928de6b 100644 --- a/system/scripts/actors/twenty-questions.js +++ b/system/scripts/actors/twenty-questions.js @@ -308,6 +308,9 @@ export class TwentyQuestions { const exceed = {}; TwentyQuestions[listName].forEach((formName) => { const id = getProperty(this.data, formName); + if (id === "none") { + return; + } if (!store[id]) { store[id] = 0; } diff --git a/system/templates/actors/character/twenty-questions-item.html b/system/templates/actors/character/twenty-questions-item.html index 7fe9bae..b7cfdc9 100644 --- a/system/templates/actors/character/twenty-questions-item.html +++ b/system/templates/actors/character/twenty-questions-item.html @@ -1,7 +1,7 @@