mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-17 01:41:22 +01:00
Prevent generating cyclical heirarchy (#930)
* Prevent generating cyclical heirarchy * Update versioning.js * update version hash
This commit is contained in:
parent
5c0254afd8
commit
87e1a1cee6
3 changed files with 5 additions and 5 deletions
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue