]> git.lizzy.rs Git - dragonfireclient.git/blobdiff - src/cavegen.cpp
Check minetest.hud_change() parameters on conversion (Fix #1714)
[dragonfireclient.git] / src / cavegen.cpp
index f04c02db9c1635ee393762d8365c03add03b6c5f..d93911f277bdda6fab4c3bdf581426b6e7a37260 100644 (file)
@@ -24,8 +24,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #include "mapgen_v7.h"
 #include "cavegen.h"
 
-NoiseParams nparams_caveliquids =
-       {0, 1, v3f(150.0, 150.0, 150.0), 776, 3, 0.6};
+NoiseParams nparams_caveliquids(0, 1, v3f(150.0, 150.0, 150.0), 776, 3, 0.6);
 
 
 ///////////////////////////////////////////////////////////////////////////////
@@ -110,9 +109,21 @@ void CaveV6::makeCave(v3s16 nmin, v3s16 nmax, int max_stone_height) {
                (float)(ps->next() % ar.Z) + 0.5
        );
 
+       int notifytype = large_cave ? GENNOTIFY_LARGECAVE_BEGIN : GENNOTIFY_CAVE_BEGIN;
+       if (mg->gennotify & (1 << notifytype)) {
+               std::vector <v3s16> *nvec = mg->gen_notifications[notifytype];
+               nvec->push_back(v3s16(of.X + orp.X, of.Y + orp.Y, of.Z + orp.Z));
+       }
+
        // Generate some tunnel starting from orp
        for (u16 j = 0; j < tunnel_routepoints; j++)
                makeTunnel(j % dswitchint == 0);
+
+       notifytype = large_cave ? GENNOTIFY_LARGECAVE_END : GENNOTIFY_CAVE_END;
+       if (mg->gennotify & (1 << notifytype)) {
+               std::vector <v3s16> *nvec = mg->gen_notifications[notifytype];
+               nvec->push_back(v3s16(of.X + orp.X, of.Y + orp.Y, of.Z + orp.Z));
+       }
 }
 
 
@@ -347,9 +358,21 @@ void CaveV7::makeCave(v3s16 nmin, v3s16 nmax, int max_stone_height) {
                (float)(ps->next() % ar.Z) + 0.5
        );
 
+       int notifytype = large_cave ? GENNOTIFY_LARGECAVE_BEGIN : GENNOTIFY_CAVE_BEGIN;
+       if (mg->gennotify & (1 << notifytype)) {
+               std::vector <v3s16> *nvec = mg->gen_notifications[notifytype];
+               nvec->push_back(v3s16(of.X + orp.X, of.Y + orp.Y, of.Z + orp.Z));
+       }
+
        // Generate some tunnel starting from orp
        for (u16 j = 0; j < tunnel_routepoints; j++)
                makeTunnel(j % dswitchint == 0);
+
+       notifytype = large_cave ? GENNOTIFY_LARGECAVE_END : GENNOTIFY_CAVE_END;
+       if (mg->gennotify & (1 << notifytype)) {
+               std::vector <v3s16> *nvec = mg->gen_notifications[notifytype];
+               nvec->push_back(v3s16(of.X + orp.X, of.Y + orp.Y, of.Z + orp.Z));
+       }
 }