summaryrefslogtreecommitdiff
path: root/src/nodedef.cpp
diff options
context:
space:
mode:
authorparamat <mat.gregory@virginmedia.com>2015-12-30 04:22:58 +0000
committerparamat <mat.gregory@virginmedia.com>2016-01-07 05:57:19 +0000
commit0bbbc6e13dc8180cf1d98f9866bc72a510162eb3 (patch)
treeb84bb2078662a03d65f8088cbb8d6be6c3b807db /src/nodedef.cpp
parentbd40ee2b95138139a8cfbef878b3461176688c15 (diff)
downloadminetest-0bbbc6e13dc8180cf1d98f9866bc72a510162eb3.tar.gz
minetest-0bbbc6e13dc8180cf1d98f9866bc72a510162eb3.tar.bz2
minetest-0bbbc6e13dc8180cf1d98f9866bc72a510162eb3.zip
Liquids: Flow into and destroy 'floodable' nodes
Add new node property 'floodable', default false Define "air" as floodable = true in C++ and lua
Diffstat (limited to 'src/nodedef.cpp')
-rw-r--r--src/nodedef.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/nodedef.cpp b/src/nodedef.cpp
index b5ccc3b94..2ebe1c131 100644
--- a/src/nodedef.cpp
+++ b/src/nodedef.cpp
@@ -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;