Skip to content

Commit

Permalink
Make facedir_to_dir and wallmounted_to_dir work with coloured nodes a…
Browse files Browse the repository at this point in the history
…s well. (#5153)
  • Loading branch information
Ekdohibs authored and sofar committed Jan 31, 2017
1 parent 74afe6f commit 3e355ab
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions builtin/game/item.lua
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 3e355ab

Please sign in to comment.