mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-22 03:51:23 +01:00
save and load biomes was broken
This commit is contained in:
parent
f6f49fd86b
commit
23c9538b79
1 changed files with 8 additions and 10 deletions
|
|
@ -584,30 +584,28 @@ function parseLoadedData(data) {
|
||||||
if (data[4]) notes = JSON.parse(data[4]);
|
if (data[4]) notes = JSON.parse(data[4]);
|
||||||
|
|
||||||
const biomes = data[3].split("|");
|
const biomes = data[3].split("|");
|
||||||
_biomesData = applyDefaultBiomesSystem();
|
|
||||||
|
|
||||||
const colorsList = biomes[0].split(",");
|
const colorsList = biomes[0].split(",");
|
||||||
const habitabilityList = biomes[1].split(",").map(h => +h);
|
const habitabilityList = biomes[1].split(",").map(h => +h);
|
||||||
const namesList = biomes[2].split(",");
|
const namesList = biomes[2].split(",");
|
||||||
|
|
||||||
biomesData = [];
|
biomesData = applyDefaultBiomesSystem();
|
||||||
|
const initialBiomes = biomesData.biomeList.length;
|
||||||
|
|
||||||
for (let i = 0; i < namesList.length; i++){
|
for (let i = 0; i < namesList.length; i++){
|
||||||
const name = namesList[i];
|
const name = namesList[i];
|
||||||
const color = colorsList[i];
|
const color = colorsList[i];
|
||||||
const habitability = habitabilityList[i];
|
const habitability = habitabilityList[i];
|
||||||
let icons;
|
let icons;
|
||||||
if (i < _biomesData.biomeList.length){
|
if (i < initialBiomes){
|
||||||
icons = _biomesData.biomeList[i].icons;
|
biomesData.biomeList[i].name = namesList[i];
|
||||||
cost = _biomesData.biomeList[i].cost;
|
biomesData.biomeList[i].color = colorsList[i];
|
||||||
|
biomesData.biomeList[i].habitability = habitabilityList[i];
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
icons = new Icons({}, 0);
|
biomesData.biomeList.push(new Biome(name, color, habitability));
|
||||||
cost = 50;
|
biomesData.biomeList[i].id = i; //don't forget the id!
|
||||||
}
|
}
|
||||||
biomesData.push(new Biome(name, color, habitability, icons, cost));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}()
|
}()
|
||||||
|
|
||||||
void function replaceSVG() {
|
void function replaceSVG() {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue