mirror of
https://github.com/joe7575/tubelib2.git
synced 2024-08-20 05:24:05 +02:00
bugfix from bugfix from bugfix
This commit is contained in:
parent
44eab11da5
commit
c40c9b6443
@ -213,19 +213,21 @@ function Tube:determine_tube_dirs(pos, preferred_pos, fdir)
|
|||||||
|
|
||||||
-- If the node at players "prefered position" is a tube,
|
-- If the node at players "prefered position" is a tube,
|
||||||
-- 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.
|
||||||
local npos, friendly = self:friendly_primary_node(preferred_pos)
|
if preferred_pos then
|
||||||
if preferred_pos and friendly then
|
local _, friendly = self:friendly_primary_node(preferred_pos)
|
||||||
local v = vector.direction(pos, preferred_pos)
|
if friendly then
|
||||||
local dir1
|
local v = vector.direction(pos, preferred_pos)
|
||||||
if v.y > 0 then
|
local dir1
|
||||||
dir1 = 6
|
if v.y > 0 then
|
||||||
elseif v.y < 0 then
|
dir1 = 6
|
||||||
dir1 = 5
|
elseif v.y < 0 then
|
||||||
else
|
dir1 = 5
|
||||||
dir1 = minetest.dir_to_facedir(v) + 1
|
else
|
||||||
|
dir1 = minetest.dir_to_facedir(v) + 1
|
||||||
|
end
|
||||||
|
local dir2 = Turn180Deg[fdir]
|
||||||
|
return dir1, dir2, 1
|
||||||
end
|
end
|
||||||
local dir2 = Turn180Deg[fdir]
|
|
||||||
return dir1, dir2, 1
|
|
||||||
end
|
end
|
||||||
-- Check for primary nodes (tubes)
|
-- Check for primary nodes (tubes)
|
||||||
for dir = 1,6 do
|
for dir = 1,6 do
|
||||||
|
Loading…
Reference in New Issue
Block a user