mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Liquids: Flow into and destroy 'floodable' nodes
Add new node property 'floodable', default false Define "air" as floodable = true in C++ and lua
This commit is contained in:
parent
bd40ee2b95
commit
0bbbc6e13d
7 changed files with 49 additions and 32 deletions
|
@ -233,6 +233,7 @@ void ContentFeatures::reset()
|
|||
diggable = true;
|
||||
climbable = false;
|
||||
buildable_to = false;
|
||||
floodable = false;
|
||||
rightclickable = true;
|
||||
leveled = 0;
|
||||
liquid_type = LIQUID_NONE;
|
||||
|
@ -318,6 +319,7 @@ void ContentFeatures::serialize(std::ostream &os, u16 protocol_version) const
|
|||
// the protocol version
|
||||
os<<serializeString(mesh);
|
||||
collision_box.serialize(os, protocol_version);
|
||||
writeU8(os, floodable);
|
||||
}
|
||||
|
||||
void ContentFeatures::deSerialize(std::istream &is)
|
||||
|
@ -388,6 +390,7 @@ void ContentFeatures::deSerialize(std::istream &is)
|
|||
// otherwise changes the protocol version
|
||||
mesh = deSerializeString(is);
|
||||
collision_box.deSerialize(is);
|
||||
floodable = readU8(is);
|
||||
}catch(SerializationError &e) {};
|
||||
}
|
||||
|
||||
|
@ -520,6 +523,7 @@ void CNodeDefManager::clear()
|
|||
f.pointable = false;
|
||||
f.diggable = false;
|
||||
f.buildable_to = true;
|
||||
f.floodable = true;
|
||||
f.is_ground_content = true;
|
||||
// Insert directly into containers
|
||||
content_t c = CONTENT_AIR;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue