diff options
author | sfan5 <sfan5@live.de> | 2020-04-10 02:43:49 +0200 |
---|---|---|
committer | Loïc Blot <nerzhul@users.noreply.github.com> | 2020-05-05 19:26:59 +0200 |
commit | c28fbd06a8bfafc9691a92c90f0cf10ec94cd314 (patch) | |
tree | 09c2dcd20ff76356bb58f055b6877f7d9d3915cd /src/mapgen | |
parent | 3c65d1acec27366d88fc3686d3f820175673e203 (diff) | |
download | minetest-c28fbd06a8bfafc9691a92c90f0cf10ec94cd314.tar.gz minetest-c28fbd06a8bfafc9691a92c90f0cf10ec94cd314.tar.bz2 minetest-c28fbd06a8bfafc9691a92c90f0cf10ec94cd314.zip |
Fix remaining issues with mapgen scriptapi
Diffstat (limited to 'src/mapgen')
-rw-r--r-- | src/mapgen/mg_biome.cpp | 3 | ||||
-rw-r--r-- | src/mapgen/mg_biome.h | 4 | ||||
-rw-r--r-- | src/mapgen/mg_schematic.cpp | 5 | ||||
-rw-r--r-- | src/mapgen/mg_schematic.h | 5 |
4 files changed, 11 insertions, 6 deletions
diff --git a/src/mapgen/mg_biome.cpp b/src/mapgen/mg_biome.cpp index f3bc4e829..8c59ac9e6 100644 --- a/src/mapgen/mg_biome.cpp +++ b/src/mapgen/mg_biome.cpp @@ -123,7 +123,8 @@ float BiomeManager::getHumidityAtPosOriginal(v3s16 pos, NoiseParams &np_humidity // For BiomeGen type 'BiomeGenOriginal' -Biome *BiomeManager::getBiomeFromNoiseOriginal(float heat, float humidity, v3s16 pos) const +const Biome *BiomeManager::getBiomeFromNoiseOriginal(float heat, + float humidity, v3s16 pos) const { Biome *biome_closest = nullptr; Biome *biome_closest_blend = nullptr; diff --git a/src/mapgen/mg_biome.h b/src/mapgen/mg_biome.h index 0a4471cc3..57f4aa20d 100644 --- a/src/mapgen/mg_biome.h +++ b/src/mapgen/mg_biome.h @@ -90,6 +90,7 @@ struct BiomeParams { s32 seed; }; +// WARNING: this class is not thread-safe class BiomeGen { public: virtual ~BiomeGen() = default; @@ -233,7 +234,8 @@ public: NoiseParams &np_heat_blend, u64 seed) const; float getHumidityAtPosOriginal(v3s16 pos, NoiseParams &np_humidity, NoiseParams &np_humidity_blend, u64 seed) const; - Biome *getBiomeFromNoiseOriginal(float heat, float humidity, v3s16 pos) const; + const Biome *getBiomeFromNoiseOriginal(float heat, float humidity, + v3s16 pos) const; private: BiomeManager() {}; diff --git a/src/mapgen/mg_schematic.cpp b/src/mapgen/mg_schematic.cpp index c3bd89f3a..ba102d997 100644 --- a/src/mapgen/mg_schematic.cpp +++ b/src/mapgen/mg_schematic.cpp @@ -359,7 +359,7 @@ bool Schematic::deserializeFromMts(std::istream *is, bool Schematic::serializeToMts(std::ostream *os, - const std::vector<std::string> &names) + const std::vector<std::string> &names) const { std::ostream &ss = *os; @@ -383,7 +383,8 @@ bool Schematic::serializeToMts(std::ostream *os, bool Schematic::serializeToLua(std::ostream *os, - const std::vector<std::string> &names, bool use_comments, u32 indent_spaces) + const std::vector<std::string> &names, bool use_comments, + u32 indent_spaces) const { std::ostream &ss = *os; diff --git a/src/mapgen/mg_schematic.h b/src/mapgen/mg_schematic.h index 3222085e6..6b31251b6 100644 --- a/src/mapgen/mg_schematic.h +++ b/src/mapgen/mg_schematic.h @@ -106,9 +106,10 @@ public: bool getSchematicFromMap(Map *map, v3s16 p1, v3s16 p2); bool deserializeFromMts(std::istream *is, std::vector<std::string> *names); - bool serializeToMts(std::ostream *os, const std::vector<std::string> &names); + bool serializeToMts(std::ostream *os, + const std::vector<std::string> &names) const; bool serializeToLua(std::ostream *os, const std::vector<std::string> &names, - bool use_comments, u32 indent_spaces); + bool use_comments, u32 indent_spaces) const; void blitToVManip(MMVManip *vm, v3s16 p, Rotation rot, bool force_place); bool placeOnVManip(MMVManip *vm, v3s16 p, u32 flags, Rotation rot, bool force_place); |