diff options
author | orwell96 <orwell@bleipb.de> | 2018-04-25 16:38:12 +0200 |
---|---|---|
committer | orwell96 <orwell@bleipb.de> | 2018-06-14 17:39:42 +0200 |
commit | 139a26fccce1e622d58f1673284e2addfb0d1ed2 (patch) | |
tree | a7df19f93e09a9b7699d93a4dbe07714164fe083 /advtrains/helpers.lua | |
parent | 30e98520e7e6fa17beaf3f1c328fd58e2b19cebc (diff) | |
download | advtrains-139a26fccce1e622d58f1673284e2addfb0d1ed2.tar.gz advtrains-139a26fccce1e622d58f1673284e2addfb0d1ed2.tar.bz2 advtrains-139a26fccce1e622d58f1673284e2addfb0d1ed2.zip |
Bugfixes part 1
There's something wrong with the new paths, next time build a path validity checker to trace the issue
Diffstat (limited to 'advtrains/helpers.lua')
-rw-r--r-- | advtrains/helpers.lua | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/advtrains/helpers.lua b/advtrains/helpers.lua index 70afadd..9ad5a8e 100644 --- a/advtrains/helpers.lua +++ b/advtrains/helpers.lua @@ -103,8 +103,8 @@ function advtrains.yawToClosestConn(yaw, conns) end
function advtrains.dir_to_angle(dir)
- local uvec = vector.normalize(advtrains.dirToCoord())
- local yaw1 = math.atan2(uvec.z, -uvec.x)
+ local uvec = vector.normalize(advtrains.dirToCoord(dir))
+ return math.atan2(uvec.z, -uvec.x)
end
@@ -304,8 +304,8 @@ function advtrains.get_adjacent_rail(this_posnr, this_conns_p, conn_idx, drives_ end
if not conn_idx then
for coni, _ in ipairs(this_conns) do
- local adj_pos, adj_conn_idx, _, nry = advtrains.get_adjacent_rail(this_pos, this_conns, coni)
- if adj_pos then return adj_pos,adj_conn_idx,coni,nry end
+ local adj_pos, adj_conn_idx, _, nry, nco = advtrains.get_adjacent_rail(this_pos, this_conns, coni)
+ if adj_pos then return adj_pos,adj_conn_idx,coni,nry, nco end
end
return nil
end
@@ -330,7 +330,7 @@ function advtrains.get_adjacent_rail(this_posnr, this_conns_p, conn_idx, drives_ end
local adj_connid = advtrains.conn_matches_to({c=conn.c, y=conn_y}, nextconns)
if adj_connid then
- return adj_pos, adj_connid, conn_idx, nextrail_y
+ return adj_pos, adj_connid, conn_idx, nextrail_y, nextconns
end
return nil
end
|