mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Rework functionality of leveled nodes (#9852)
Co-authored-by: sfan5 <sfan5@live.de> Co-authored-by: SmallJoker <SmallJoker@users.noreply.github.com>
This commit is contained in:
parent
7d3972a504
commit
c94d37827d
8 changed files with 79 additions and 34 deletions
|
@ -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) {};
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue