summaryrefslogtreecommitdiff
path: root/src/nodedef.cpp
diff options
context:
space:
mode:
authorWuzzy <wuzzy2@mail.ru>2020-05-19 21:08:37 +0200
committerGitHub <noreply@github.com>2020-05-19 21:08:37 +0200
commitc94d37827dd3a8be9dcc59bb693032ba7ea07922 (patch)
treeada7fd843d405f8ec6f1c43b749f553f4a215214 /src/nodedef.cpp
parent7d3972a5049324f776ab008894c34569641f0073 (diff)
downloadminetest-c94d37827dd3a8be9dcc59bb693032ba7ea07922.tar.gz
minetest-c94d37827dd3a8be9dcc59bb693032ba7ea07922.tar.bz2
minetest-c94d37827dd3a8be9dcc59bb693032ba7ea07922.zip
Rework functionality of leveled nodes (#9852)
Co-authored-by: sfan5 <sfan5@live.de> Co-authored-by: SmallJoker <SmallJoker@users.noreply.github.com>
Diffstat (limited to 'src/nodedef.cpp')
-rw-r--r--src/nodedef.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/nodedef.cpp b/src/nodedef.cpp
index 65199830f..b8211fceb 100644
--- a/src/nodedef.cpp
+++ b/src/nodedef.cpp
@@ -368,6 +368,7 @@ void ContentFeatures::reset()
floodable = false;
rightclickable = true;
leveled = 0;
+ leveled_max = LEVELED_MAX;
liquid_type = LIQUID_NONE;
liquid_alternative_flowing = "";
liquid_alternative_source = "";
@@ -478,6 +479,7 @@ void ContentFeatures::serialize(std::ostream &os, u16 protocol_version) const
writeU8(os, legacy_wallmounted);
os << serializeString(node_dig_prediction);
+ writeU8(os, leveled_max);
}
void ContentFeatures::correctAlpha(TileDef *tiles, int length)
@@ -586,6 +588,10 @@ void ContentFeatures::deSerialize(std::istream &is)
try {
node_dig_prediction = deSerializeString(is);
+ u8 tmp_leveled_max = readU8(is);
+ if (is.eof()) /* readU8 doesn't throw exceptions so we have to do this */
+ throw SerializationError("");
+ leveled_max = tmp_leveled_max;
} catch(SerializationError &e) {};
}