]> git.lizzy.rs Git - minetest.git/blobdiff - src/mapgen.cpp
Rework texture generating code, add texture grouping via ( ... )
[minetest.git] / src / mapgen.cpp
index d97c3e609020a26bb6ae1fbb982058b92e164c11..1a31a8bcb0d728f35c74266a12aaf6490bbf1476 100644 (file)
@@ -41,12 +41,12 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 
 
 FlagDesc flagdesc_mapgen[] = {
-       {"trees",          MG_TREES},
-       {"caves",          MG_CAVES},
-       {"dungeons",       MG_DUNGEONS},
-       {"flat",           MG_FLAT},
-       {"nolight",        MG_NOLIGHT},
-       {NULL,             0}
+       {"trees",    MG_TREES},
+       {"caves",    MG_CAVES},
+       {"dungeons", MG_DUNGEONS},
+       {"flat",     MG_FLAT},
+       {"light",    MG_LIGHT},
+       {NULL,       0}
 };
 
 FlagDesc flagdesc_ore[] = {
@@ -652,7 +652,7 @@ void DecoSchematic::blitToVManip(v3s16 p, ManualMapVoxelManipulator *vm,
 }
 
 
-void DecoSchematic::placeStructure(Map *map, v3s16 p) {
+void DecoSchematic::placeStructure(Map *map, v3s16 p, bool force_placement) {
        assert(schematic != NULL);
        ManualMapVoxelManipulator *vm = new ManualMapVoxelManipulator(map);
 
@@ -673,7 +673,7 @@ void DecoSchematic::placeStructure(Map *map, v3s16 p) {
        v3s16 bp2 = getNodeBlockPos(p + s - v3s16(1,1,1));
        vm->initialEmerge(bp1, bp2);
 
-       blitToVManip(p, vm, rot, true);
+       blitToVManip(p, vm, rot, force_placement);
 
        std::map<v3s16, MapBlock *> lighting_modified_blocks;
        std::map<v3s16, MapBlock *> modified_blocks;
@@ -977,10 +977,8 @@ void Mapgen::updateHeightmap(v3s16 nmin, v3s16 nmax) {
 
 
 void Mapgen::updateLiquid(UniqueQueue<v3s16> *trans_liquid, v3s16 nmin, v3s16 nmax) {
-       bool isliquid, wasliquid, rare;
+       bool isliquid, wasliquid;
        v3s16 em  = vm->m_area.getExtent();
-       rare = g_settings->getBool("liquid_finite");
-       int rarecnt = 0;
 
        for (s16 z = nmin.Z; z <= nmax.Z; z++) {
                for (s16 x = nmin.X; x <= nmax.X; x++) {
@@ -990,8 +988,8 @@ void Mapgen::updateLiquid(UniqueQueue<v3s16> *trans_liquid, v3s16 nmin, v3s16 nm
                        for (s16 y = nmax.Y; y >= nmin.Y; y--) {
                                isliquid = ndef->get(vm->m_data[i]).isLiquid();
 
-                               // there was a change between liquid and nonliquid, add to queue. no need to add every with liquid_finite
-                               if (isliquid != wasliquid && (!rare || !(rarecnt++ % 36)))
+                               // there was a change between liquid and nonliquid, add to queue.
+                               if (isliquid != wasliquid)
                                        trans_liquid->push_back(v3s16(x, y, z));
 
                                wasliquid = isliquid;