v0.8, dir_to_facedir bugfix

This commit is contained in:
Joachim Stolberg 2019-01-11 21:52:21 +01:00
parent 22179299b5
commit 68e9abcd93
3 changed files with 10 additions and 2 deletions

@ -69,4 +69,5 @@ Textures: CC0
- 2018-12-16 v0.5 * meta data removed, memory cache added instead of - 2018-12-16 v0.5 * meta data removed, memory cache added instead of
- 2018-12-20 v0.6 * intllib support added, max tube length bugfix - 2018-12-20 v0.6 * intllib support added, max tube length bugfix
- 2019-01-06 v0.7 * API function replace_tube_line added, bug fixed - 2019-01-06 v0.7 * API function replace_tube_line added, bug fixed
- 2019-01-11 v0.8 * dir_to_facedir bugfix

@ -204,7 +204,14 @@ function Tube:determine_tube_dirs(pos, preferred_pos, fdir)
-- then the other side of the new tube shall point to the player. -- then the other side of the new tube shall point to the player.
if preferred_pos and self:friendly_primary_node(preferred_pos) then if preferred_pos and self:friendly_primary_node(preferred_pos) then
local v = vector.direction(pos, preferred_pos) local v = vector.direction(pos, preferred_pos)
local dir1 = minetest.dir_to_facedir(v, true) + 1 local dir1
if v.y > 0 then
dir1 = 6
elseif v.y < 0 then
dir1 = 5
else
dir1 = minetest.dir_to_facedir(v) + 1
end
local dir2 = Turn180Deg[fdir] local dir2 = Turn180Deg[fdir]
return dir1, dir2, 1 return dir1, dir2, 1
end end

@ -13,7 +13,7 @@
]]-- ]]--
-- Version for compatibility checks, see readme.md/history -- Version for compatibility checks, see readme.md/history
tubelib2.version = 0.5 tubelib2.version = 0.8
-- for lazy programmers -- for lazy programmers
local S = function(pos) if pos then return minetest.pos_to_string(pos) end end local S = function(pos) if pos then return minetest.pos_to_string(pos) end end