From 53cb2ed34245e416c2362a2367ff62609a142c3b Mon Sep 17 00:00:00 2001 From: Canis Artorus Date: Tue, 7 Feb 2023 23:16:04 -0700 Subject: [PATCH] Syntax / Typo --- modules/dynamic/editors/religions-editor.js | 2 +- modules/religions-generator.js | 17 ++++++++--------- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/modules/dynamic/editors/religions-editor.js b/modules/dynamic/editors/religions-editor.js index 917db90f..419b191e 100644 --- a/modules/dynamic/editors/religions-editor.js +++ b/modules/dynamic/editors/religions-editor.js @@ -832,7 +832,7 @@ function recalculateReligions(must) { Religions.resetUnlockedReligions(); Religions.expandReligions(); Religions.expandHeresies(); - Religions.checkReligionCentres(); + Religions.checkReligionCenters(); drawReligions(); refreshReligionsEditor(); diff --git a/modules/religions-generator.js b/modules/religions-generator.js index 38e57546..6d73c34c 100644 --- a/modules/religions-generator.js +++ b/modules/religions-generator.js @@ -569,13 +569,12 @@ window.Religions = (function () { }; // growth algorithm to assign cells to religions - const expandReligions = function() { + function expandReligions() { const queue = new PriorityQueue({comparator: (a, b) => a.p - b.p}); const cost = []; const religionIds = pack.cells.religion; const cells = pack.cells; - pack.religions .filter(r => !r.lock && (r.type === "Organized" || r.type === "Cult")) .forEach(r => { @@ -614,10 +613,10 @@ window.Religions = (function () { } }); } - }; + } // growth algorithm to assign cells to heresies - const expandHeresies = function() { + function expandHeresies() { const queue = new PriorityQueue({comparator: (a, b) => a.p - b.p}); const cost = []; const religionIds = pack.cells.religion; @@ -655,9 +654,9 @@ window.Religions = (function () { } }); } - }; + } - const checkReligionCenters = function() { + function checkReligionCenters() { const codes = pack.religions.map(r => r.code); pack.religions.forEach(r => { if (!r.i) return; @@ -668,7 +667,7 @@ window.Religions = (function () { const firstCell = pack.cells.i.find(i => pack.cells.religion[i] === r.i); if (firstCell) r.center = firstCell; // move center, othervise it's an extinct religion }); - }; + } const add = function (center) { const {cells, religions} = pack; @@ -810,7 +809,7 @@ window.Religions = (function () { const culture = pack.cells.culture; // ignore cultures added since last folk generation. Known Issue let knownFolk = 1; - for(const j = 1; j++; j