diff options
author | Nathanaƫl Courant <Ekdohibs@users.noreply.github.com> | 2017-02-01 00:02:30 +0100 |
---|---|---|
committer | Auke Kok <sofar+github@foo-projects.org> | 2017-01-31 15:02:30 -0800 |
commit | 3e355ab7d5ccdcd77f104eee57237828410b85d7 (patch) | |
tree | a1d2e9529b4bc718a8327920cd77900b430594b8 /builtin | |
parent | 74afe6fe6bf5bd6eeba3b6f4fbbfbe8758e7f750 (diff) | |
download | minetest-3e355ab7d5ccdcd77f104eee57237828410b85d7.tar.gz minetest-3e355ab7d5ccdcd77f104eee57237828410b85d7.tar.bz2 minetest-3e355ab7d5ccdcd77f104eee57237828410b85d7.zip |
Make facedir_to_dir and wallmounted_to_dir work with coloured nodes as well. (#5153)
Diffstat (limited to 'builtin')
-rw-r--r-- | builtin/game/item.lua | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/builtin/game/item.lua b/builtin/game/item.lua index e51da6d6b..a8dc51d61 100644 --- a/builtin/game/item.lua +++ b/builtin/game/item.lua @@ -109,7 +109,7 @@ local facedir_to_dir_map = { 1, 4, 3, 2, } function core.facedir_to_dir(facedir) - return facedir_to_dir[facedir_to_dir_map[facedir]] + return facedir_to_dir[facedir_to_dir_map[facedir % 32]] end function core.dir_to_wallmounted(dir) @@ -144,7 +144,7 @@ local wallmounted_to_dir = { {x = 0, y = 0, z = -1}, } function core.wallmounted_to_dir(wallmounted) - return wallmounted_to_dir[wallmounted] + return wallmounted_to_dir[wallmounted % 8] end function core.dir_to_yaw(dir) |