diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/mapnode.cpp | 5 | ||||
-rw-r--r-- | src/mapnode.h | 4 |
2 files changed, 4 insertions, 5 deletions
diff --git a/src/mapnode.cpp b/src/mapnode.cpp index 9b6a39e1b..c46719a68 100644 --- a/src/mapnode.cpp +++ b/src/mapnode.cpp @@ -250,9 +250,8 @@ void transformNodeBox(const MapNode &n, const NodeBox &nodebox, u8 axisdir = facedir>>2; facedir&=0x03; for (aabb3f box : fixed) { - if (nodebox.type == NODEBOX_LEVELED) { - box.MaxEdge.Y = -BS/2 + BS*((float)1/LEVELED_MAX) * n.getLevel(nodemgr); - } + if (nodebox.type == NODEBOX_LEVELED) + box.MaxEdge.Y = (-0.5f + n.getLevel(nodemgr) / 64.0f) * BS; switch (axisdir) { case 0: diff --git a/src/mapnode.h b/src/mapnode.h index 1e7597e4d..338ae41fe 100644 --- a/src/mapnode.h +++ b/src/mapnode.h @@ -102,8 +102,8 @@ enum Rotation { #define LIQUID_INFINITY_MASK 0x80 //0b10000000 -// mask for param2, now as for liquid -#define LEVELED_MASK 0x3F +// mask for leveled nodebox param2 +#define LEVELED_MASK 0x7F #define LEVELED_MAX LEVELED_MASK |