diff --git a/modules/ui/burg-editor.js b/modules/ui/burg-editor.js index 8b20cee3..fb2ae648 100644 --- a/modules/ui/burg-editor.js +++ b/modules/ui/burg-editor.js @@ -402,22 +402,16 @@ function editBurg(id) { document.getElementById("mfcgPreview").setAttribute("src", mfcgURL); document.getElementById("mfcgLink").setAttribute("href", mfcgURL); } - - function openMFCG(seed) { - if (!seed && burg.MFCGlink) { - openURL(burg.MFCGlink); - return; - } - const cells = pack.cells; - const name = elSelected.text(); - const size = Math.ceil(2.13*Math.pow(burg.population * populationRate / urbanDensity,0.385));//Math.max(Math.min(rn(burg.population), 100), 6); // to be removed once change on MFDC is done - const population = rn(burg.population * populationRate * urbanization); + function getBurgSeed(burg) { + return burg.MFCG || Number(`${seed}${String(burg.i).padStart(4, 0)}`); + } function getMFCGlink(burg) { const {cells} = pack; const {name, population, cell} = burg; const burgSeed = getBurgSeed(burg); const size = Math.max(Math.min(rn(population), 100), 6); + const size = Math.max(Math.min(Math.ceil(2.13*Math.pow(burg.population * populationRate)), 100), 6); const people = rn(population * populationRate * urbanization); const hub = +cells.road[cell] > 50;