diff options
author | SmallJoker <mk939@ymail.com> | 2020-09-20 13:12:55 +0200 |
---|---|---|
committer | Loïc Blot <nerzhul@users.noreply.github.com> | 2020-10-01 09:52:59 +0200 |
commit | 947466ab28129fd69e6630974c6c4e901f2bebc6 (patch) | |
tree | 720b35a5f8c01e42a5078f7fb79d612d1a1484d9 /src/mapgen | |
parent | ca5c2dbefab3676514e48b445b36de50993de9f1 (diff) | |
download | minetest-947466ab28129fd69e6630974c6c4e901f2bebc6.tar.gz minetest-947466ab28129fd69e6630974c6c4e901f2bebc6.tar.bz2 minetest-947466ab28129fd69e6630974c6c4e901f2bebc6.zip |
(se)SerializeString: Include max length in the name
This commit clarifies the maximal length of the serialized strings.
It will avoid accidental use of serializeString() when a larger string can be expected.
Removes unused Wide String serialization functions
Diffstat (limited to 'src/mapgen')
-rw-r--r-- | src/mapgen/mg_schematic.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/mapgen/mg_schematic.cpp b/src/mapgen/mg_schematic.cpp index ba102d997..dfd414709 100644 --- a/src/mapgen/mg_schematic.cpp +++ b/src/mapgen/mg_schematic.cpp @@ -314,7 +314,7 @@ bool Schematic::deserializeFromMts(std::istream *is, //// Read node names u16 nidmapcount = readU16(ss); for (int i = 0; i != nidmapcount; i++) { - std::string name = deSerializeString(ss); + std::string name = deSerializeString16(ss); // Instances of "ignore" from v1 are converted to air (and instances // are fixed to have MTSCHEM_PROB_NEVER later on). @@ -372,7 +372,7 @@ bool Schematic::serializeToMts(std::ostream *os, writeU16(ss, names.size()); // name count for (size_t i = 0; i != names.size(); i++) - ss << serializeString(names[i]); // node names + ss << serializeString16(names[i]); // node names // compressed bulk node data MapNode::serializeBulk(ss, SER_FMT_VER_HIGHEST_WRITE, |