diff options
author | paramat <paramat@users.noreply.github.com> | 2017-09-18 05:08:56 +0100 |
---|---|---|
committer | paramat <mat.gregory@virginmedia.com> | 2017-09-18 11:05:39 +0100 |
commit | d8f20d029a17551dab35a850bed48a62c1a02618 (patch) | |
tree | eee07899e187e8a6ebd835f46160391a76c0dfcf /src/mapnode.cpp | |
parent | 27144b471678b30156ad3383fb8d26a5bd9b66cb (diff) | |
download | minetest-d8f20d029a17551dab35a850bed48a62c1a02618.tar.gz minetest-d8f20d029a17551dab35a850bed48a62c1a02618.tar.bz2 minetest-d8f20d029a17551dab35a850bed48a62c1a02618.zip |
Leveled nodebox: Change levels from 1/63rds to 1/64ths
Add missing documentation of leveled nodebox to lua_api.txt, plus
a little cleaning up nearby.
Diffstat (limited to 'src/mapnode.cpp')
-rw-r--r-- | src/mapnode.cpp | 5 |
1 files changed, 2 insertions, 3 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: |