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/server/unit_sao.cpp | |
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/server/unit_sao.cpp')
-rw-r--r-- | src/server/unit_sao.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/server/unit_sao.cpp b/src/server/unit_sao.cpp index ef0e87f2c..d906e885e 100644 --- a/src/server/unit_sao.cpp +++ b/src/server/unit_sao.cpp @@ -242,7 +242,7 @@ std::string UnitSAO::generateUpdateAttachmentCommand() const writeU8(os, AO_CMD_ATTACH_TO); // parameters writeS16(os, m_attachment_parent_id); - os << serializeString(m_attachment_bone); + os << serializeString16(m_attachment_bone); writeV3F32(os, m_attachment_position); writeV3F32(os, m_attachment_rotation); return os.str(); @@ -255,7 +255,7 @@ std::string UnitSAO::generateUpdateBonePositionCommand( // command writeU8(os, AO_CMD_SET_BONE_POSITION); // parameters - os << serializeString(bone); + os << serializeString16(bone); writeV3F32(os, position); writeV3F32(os, rotation); return os.str(); @@ -291,7 +291,7 @@ std::string UnitSAO::generateUpdateArmorGroupsCommand() const writeU8(os, AO_CMD_UPDATE_ARMOR_GROUPS); writeU16(os, m_armor_groups.size()); for (const auto &armor_group : m_armor_groups) { - os << serializeString(armor_group.first); + os << serializeString16(armor_group.first); writeS16(os, armor_group.second); } return os.str(); |