Browse Source

fix world generation bug that leads to missing ground blocks

Kolja Strohm 1 year ago
parent
commit
8789b87374

+ 1 - 0
FactoryCraft/DimensionGenerator.cpp

@@ -328,6 +328,7 @@ Framework::Either<Block*, int> BiomedCavedDimensionGenerator::generateBlock(
     zMemory()->setFloatVariable("x", (float)location.x);
     zMemory()->setFloatVariable("y", (float)location.y);
 
+    calculateHeightLayers();
     BiomGenerator* biom = zBiomGenerator();
 
     zMemory()->setFloatVariable("z", (float)location.z);

+ 1 - 1
FactoryCraft/WorldGenerator.cpp

@@ -17,7 +17,7 @@ WorldGenerator::WorldGenerator(int seed)
       seed(seed)
 {
     setName("World Generator");
-    std::cout << "loading world generator configs. Changes at the config giles "
+    std::cout << "loading world generator configs. Changes at the config files "
                  "may lead to a sudden change in landscape.\n";
     JSONValidator* validator = buildConfigValidator();
     loadConfig("data/generator", validator);

+ 10 - 8
Windows Version/data/generator/overworld.json

@@ -332,8 +332,8 @@
                       "name": "h"
                     },
                     {
-                      "type": "number",
-                      "name": 190
+                      "type": "constant",
+                      "value": 190
                     }
                   ]
                 },
@@ -346,13 +346,14 @@
                       "name": "h"
                     },
                     {
-                      "type": "number",
-                      "name": 300
+                      "type": "constant",
+                      "value": 300
                     }
                   ]
                 }
               ]
             }
+          }
         ],
         "blocks": [
           {
@@ -385,13 +386,14 @@
                       "name": "z"
                     },
                     {
-                      "type": "number",
-                      "name": 190
+                      "type": "constant",
+                      "value": 190
                     }
                   ]
                 }
               ]
-            },
+            }
+          },
           {
             "type": "blockType",
             "blockType": "Air",
@@ -652,7 +654,7 @@
             "blockType": "Stone",
             "condition": {
               "type": "operator",
-              "operator": "<i",
+              "operator": "<=i",
               "values": [
                 {
                   "type": "variable",