Skip to content
Snippets Groups Projects
Commit cf568a5f authored by Peter Nerlich's avatar Peter Nerlich
Browse files

only consider 45deg turns instead of 90deg

parent 4b2e5416
No related branches found
No related tags found
No related merge requests found
...@@ -548,11 +548,11 @@ recalculate_line_to = function(pos_a, pos_b, meta_a, meta_b) ...@@ -548,11 +548,11 @@ recalculate_line_to = function(pos_a, pos_b, meta_a, meta_b)
else else
local inconn = next_conns[adj_connid] local inconn = next_conns[adj_connid]
-- query the next conns -- query the next conns
local quarter = AT_CMAX/4 local deg45 = AT_CMAX/8
for nconnid, nconn in ipairs(next_conns) do for nconnid, nconn in ipairs(next_conns) do
local normed = (nconn.c-inconn.c)%AT_CMAX local normed = (nconn.c-inconn.c)%AT_CMAX
-- only accept conns that turn 90deg at most -- only accept conns that turn 90deg at most
if normed >= quarter and normed <= quarter*3 then if normed >= deg45 and normed <= AT_CMAX-deg45 then
local line = clone(min_item.line) local line = clone(min_item.line)
if nconn.c ~= inconn.c then if nconn.c ~= inconn.c then
table.insert(line, minetest.pos_to_string(adj_pos)) table.insert(line, minetest.pos_to_string(adj_pos))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment