diff options
author | Loïc Blot <loic.blot@unix-experience.fr> | 2017-06-06 16:19:04 +0200 |
---|---|---|
committer | Loïc Blot <loic.blot@unix-experience.fr> | 2017-06-06 16:19:04 +0200 |
commit | 8bdde45895658f16aa6b2546ccb59c5c4c9fc699 (patch) | |
tree | 33fd9c49f42a0f9a3194d68c74aee1c99ab6cec4 /src/mapblock.cpp | |
parent | fee5171298606d928d0f718d8ec0eeb2cacc1e71 (diff) | |
download | minetest-8bdde45895658f16aa6b2546ccb59c5c4c9fc699.tar.gz minetest-8bdde45895658f16aa6b2546ccb59c5c4c9fc699.tar.bz2 minetest-8bdde45895658f16aa6b2546ccb59c5c4c9fc699.zip |
Revert "Remove deprecated code segments (#5891)"
This reverts commit 599e13e95e81aadb959c9f3715aec9b425ede084.
Diffstat (limited to 'src/mapblock.cpp')
-rw-r--r-- | src/mapblock.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/mapblock.cpp b/src/mapblock.cpp index 07912b9a2..ec10a49bb 100644 --- a/src/mapblock.cpp +++ b/src/mapblock.cpp @@ -27,6 +27,7 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "gamedef.h" #include "log.h" #include "nameidmapping.h" +#include "content_mapnode.h" // For legacy name-id mapping #include "content_nodemeta.h" // For legacy deserialization #include "serialization.h" #ifndef SERVER @@ -930,7 +931,12 @@ void MapBlock::deSerialize_pre22(std::istream &is, u8 version, bool disk) // Dynamically re-set ids based on node names NameIdMapping nimap; // If supported, read node definition id mapping - nimap.deSerialize(is); + if (version >= 21) { + nimap.deSerialize(is); + // Else set the legacy mapping + } else { + content_mapnode_get_name_id_mapping(&nimap); + } correctBlockNodeIds(&nimap, data, m_gamedef); } |