Prevent generating cyclical heirarchy (#930)

* Prevent generating cyclical heirarchy

* Update versioning.js

* update version hash
This commit is contained in:
Alexander James 2023-03-26 09:18:25 -06:00 committed by GitHub
parent 5c0254afd8
commit 87e1a1cee6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 5 deletions

View file

@ -597,7 +597,7 @@ window.Religions = (function () {
checked[neibId] = true;
const neibReligion = religionIds[neibId];
if (neibReligion && neibReligion !== religionId) foundReligions.add(neibReligion);
if (neibReligion && neibReligion < religionId) foundReligions.add(neibReligion);
if (foundReligions.size >= maxReligions) return [...foundReligions];
queue.push(neibId);
}
@ -714,6 +714,7 @@ window.Religions = (function () {
const add = function (center) {
const {cells, cultures, religions} = pack;
const religionId = cells.religion[center];
const i = religions.length;
const cultureId = cells.culture[center];
const missingFolk =
@ -741,10 +742,9 @@ window.Religions = (function () {
name,
religions.map(r => r.code)
);
const influences = getReligionsInRadius(cells.c, center, cells.religion, 0, 25, 3, 0);
const influences = getReligionsInRadius(cells.c, center, cells.religion, i, 25, 3, 0);
const origins = type === "Folk" ? [0] : influences;
const i = religions.length;
religions.push({
i,
name,