mirror of
https://github.com/joe7575/tubelib2.git
synced 2024-10-04 00:43:14 +02:00
v0.8, dir_to_facedir bugfix
This commit is contained in:
parent
22179299b5
commit
68e9abcd93
@ -69,4 +69,5 @@ Textures: CC0
|
||||
- 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
|
||||
- 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.
|
||||
if preferred_pos and self:friendly_primary_node(preferred_pos) then
|
||||
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]
|
||||
return dir1, dir2, 1
|
||||
end
|
||||
|
@ -13,7 +13,7 @@
|
||||
]]--
|
||||
|
||||
-- Version for compatibility checks, see readme.md/history
|
||||
tubelib2.version = 0.5
|
||||
tubelib2.version = 0.8
|
||||
|
||||
-- for lazy programmers
|
||||
local S = function(pos) if pos then return minetest.pos_to_string(pos) end end
|
||||
|
Loading…
Reference in New Issue
Block a user