mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-05 19:11:50 +00:00
feat: heightmap-inputs
This commit is contained in:
parent
5e79bc07e9
commit
59c4e26eda
10 changed files with 76 additions and 14 deletions
|
|
@ -202,7 +202,20 @@ void ContentLoader::loadGenerator(
|
|||
map.at("heights-bpd").get(def.heightsBPD);
|
||||
map.at("sea-level").get(def.seaLevel);
|
||||
map.at("wide-structs-chunks-radius").get(def.wideStructsChunksRadius);
|
||||
|
||||
if (map.has("heightmap-inputs")) {
|
||||
for (const auto& element : map["heightmap-inputs"]) {
|
||||
int index = element.asInteger();
|
||||
if (index <= 0 || index > def.biomeParameters) {
|
||||
throw std::runtime_error(
|
||||
"invalid biome parameter index " + std::to_string(index));
|
||||
}
|
||||
def.heightmapInputs.push_back(index - 1);
|
||||
}
|
||||
}
|
||||
if (!def.heightmapInputs.empty() && def.biomesBPD != def.heightsBPD) {
|
||||
logger.warning() << "generator has heightmap-inputs but biomes-bpd "
|
||||
"is not equal to heights-bpd, generator will work slower!";
|
||||
}
|
||||
auto folder = generatorsDir / fs::u8path(name + ".files");
|
||||
auto scriptFile = folder / fs::u8path("script.lua");
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue