summaryrefslogtreecommitdiff
path: root/src/mapnode.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/mapnode.h')
-rw-r--r--src/mapnode.h28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/mapnode.h b/src/mapnode.h
index 910239136..789cedb27 100644
--- a/src/mapnode.h
+++ b/src/mapnode.h
@@ -133,6 +133,34 @@ inline u8 material_solidness(u8 m)
return 2;
}
+// Objects collide with walkable materials
+inline bool material_walkable(u8 m)
+{
+ return (m != MATERIAL_AIR && m != MATERIAL_WATER);
+}
+
+// A liquid resists fast movement
+inline bool material_liquid(u8 m)
+{
+ return (m == MATERIAL_WATER);
+}
+
+// Pointable materials can be pointed to in the map
+inline bool material_pointable(u8 m)
+{
+ return (m != MATERIAL_AIR && m != MATERIAL_WATER);
+}
+
+inline bool material_diggable(u8 m)
+{
+ return (m != MATERIAL_AIR && m != MATERIAL_WATER);
+}
+
+inline bool material_buildable_to(u8 m)
+{
+ return (m == MATERIAL_AIR || m == MATERIAL_WATER);
+}
+
/*
Nodes make a face if materials differ and solidness differs.
Return value: