Fix a memleak pointed by @Zeno- in MeshUpdateQueue
[oweals/minetest.git] / src / mg_ore.cpp
index 2579016144742a6ad95a0fd3d3a69e77c181975a..c6c1c45a782bd2270d0e239bd9ea41b76c8c3bec 100644 (file)
@@ -20,9 +20,10 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #include "mg_ore.h"
 #include "mapgen.h"
 #include "noise.h"
-#include "util/numeric.h"
 #include "map.h"
 #include "log.h"
+#include <algorithm>
+
 
 FlagDesc flagdesc_ore[] = {
        {"absheight",                 OREFLAG_ABSHEIGHT},
@@ -148,7 +149,7 @@ void OreScatter::generate(MMVManip *vm, int mapseed, u32 blockseed,
 
                if (biomemap && !biomes.empty()) {
                        u32 index = sizex * (z0 - nmin.Z) + (x0 - nmin.X);
-                       std::set<u8>::iterator it = biomes.find(biomemap[index]);
+                       UNORDERED_SET<u8>::iterator it = biomes.find(biomemap[index]);
                        if (it == biomes.end())
                                continue;
                }
@@ -202,7 +203,7 @@ void OreSheet::generate(MMVManip *vm, int mapseed, u32 blockseed,
                        continue;
 
                if (biomemap && !biomes.empty()) {
-                       std::set<u8>::iterator it = biomes.find(biomemap[index]);
+                       UNORDERED_SET<u8>::iterator it = biomes.find(biomemap[index]);
                        if (it == biomes.end())
                                continue;
                }
@@ -270,7 +271,7 @@ void OrePuff::generate(MMVManip *vm, int mapseed, u32 blockseed,
                        continue;
 
                if (biomemap && !biomes.empty()) {
-                       std::set<u8>::iterator it = biomes.find(biomemap[index]);
+                       UNORDERED_SET<u8>::iterator it = biomes.find(biomemap[index]);
                        if (it == biomes.end())
                                continue;
                }
@@ -338,7 +339,7 @@ void OreBlob::generate(MMVManip *vm, int mapseed, u32 blockseed,
 
                if (biomemap && !biomes.empty()) {
                        u32 bmapidx = sizex * (z0 - nmin.Z) + (x0 - nmin.X);
-                       std::set<u8>::iterator it = biomes.find(biomemap[bmapidx]);
+                       UNORDERED_SET<u8>::iterator it = biomes.find(biomemap[bmapidx]);
                        if (it == biomes.end())
                                continue;
                }
@@ -422,7 +423,7 @@ void OreVein::generate(MMVManip *vm, int mapseed, u32 blockseed,
 
                if (biomemap && !biomes.empty()) {
                        u32 bmapidx = sizex * (z - nmin.Z) + (x - nmin.X);
-                       std::set<u8>::iterator it = biomes.find(biomemap[bmapidx]);
+                       UNORDERED_SET<u8>::iterator it = biomes.find(biomemap[bmapidx]);
                        if (it == biomes.end())
                                continue;
                }