]> git.lizzy.rs Git - minetest.git/blobdiff - src/mg_ore.h
Fix mapgen using unitialised height map values
[minetest.git] / src / mg_ore.h
index bd81a63fb3e880cf02b6b0eb2987ee01644e5560..67ca9a849630f03d1ad5801ab157ecf4e10874e1 100644 (file)
@@ -26,7 +26,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 struct NoiseParams;
 class Noise;
 class Mapgen;
-class ManualMapVoxelManipulator;
+class MMVManip;
 
 /////////////////// Ore generation flags
 
@@ -56,8 +56,8 @@ class Ore : public GenElement, public NodeResolver {
        u32 clust_scarcity; // ore cluster has a 1-in-clust_scarcity chance of appearing at a node
        s16 clust_num_ores; // how many ore nodes are in a chunk
        s16 clust_size;     // how large (in nodes) a chunk of ore is
-       s16 height_min;
-       s16 height_max;
+       s16 y_min;
+       s16 y_max;
        u8 ore_param2;          // to set node-specific attributes
        u32 flags;          // attributes for this ore
        float nthresh;      // threshhold for noise at which an ore is placed
@@ -70,32 +70,32 @@ class Ore : public GenElement, public NodeResolver {
        virtual void resolveNodeNames(NodeResolveInfo *nri);
 
        size_t placeOre(Mapgen *mg, u32 blockseed, v3s16 nmin, v3s16 nmax);
-       virtual void generate(ManualMapVoxelManipulator *vm, int seed,
-               u32 blockseed, v3s16 nmin, v3s16 nmax) = 0;
+       virtual void generate(MMVManip *vm, int mapseed, u32 blockseed,
+               v3s16 nmin, v3s16 nmax) = 0;
 };
 
 class OreScatter : public Ore {
 public:
        static const bool NEEDS_NOISE = false;
 
-       virtual void generate(ManualMapVoxelManipulator *vm, int seed,
-               u32 blockseed, v3s16 nmin, v3s16 nmax);
+       virtual void generate(MMVManip *vm, int mapseed, u32 blockseed,
+               v3s16 nmin, v3s16 nmax);
 };
 
 class OreSheet : public Ore {
 public:
        static const bool NEEDS_NOISE = true;
 
-       virtual void generate(ManualMapVoxelManipulator *vm, int seed,
-               u32 blockseed, v3s16 nmin, v3s16 nmax);
+       virtual void generate(MMVManip *vm, int mapseed, u32 blockseed,
+               v3s16 nmin, v3s16 nmax);
 };
 
 class OreBlob : public Ore {
 public:
        static const bool NEEDS_NOISE = true;
 
-       virtual void generate(ManualMapVoxelManipulator *vm, int seed,
-               u32 blockseed, v3s16 nmin, v3s16 nmax);
+       virtual void generate(MMVManip *vm, int mapseed, u32 blockseed,
+               v3s16 nmin, v3s16 nmax);
 };
 
 class OreVein : public Ore {
@@ -105,10 +105,11 @@ class OreVein : public Ore {
        float random_factor;
        Noise *noise2;
 
+       OreVein();
        virtual ~OreVein();
 
-       virtual void generate(ManualMapVoxelManipulator *vm, int seed,
-               u32 blockseed, v3s16 nmin, v3s16 nmax);
+       virtual void generate(MMVManip *vm, int mapseed, u32 blockseed,
+               v3s16 nmin, v3s16 nmax);
 };
 
 class OreManager : public GenElementManager {
@@ -137,7 +138,7 @@ class OreManager : public GenElementManager {
 
        void clear();
 
-       size_t placeAllOres(Mapgen *mg, u32 seed, v3s16 nmin, v3s16 nmax);
+       size_t placeAllOres(Mapgen *mg, u32 blockseed, v3s16 nmin, v3s16 nmax);
 };
 
 #endif