From 2067ab0a90550b2fc513e032d4c4e54dd11a2290 Mon Sep 17 00:00:00 2001 From: orwell Date: Sun, 15 Oct 2023 15:48:59 +0200 Subject: Use conn_map in the path calculation --- advtrains/tracks.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'advtrains/tracks.lua') diff --git a/advtrains/tracks.lua b/advtrains/tracks.lua index 1abef59..661da8a 100644 --- a/advtrains/tracks.lua +++ b/advtrains/tracks.lua @@ -235,6 +235,8 @@ function advtrains.is_track(nodename) return false end +-- returns the connection tables of the track with given node details +-- returns: conns table, railheight, conn_map table function advtrains.get_track_connections(name, param2) local nodedef=minetest.registered_nodes[name] if not nodedef then atprint(" get_track_connections couldn't find nodedef for nodename "..(name or "nil")) return nil end @@ -246,7 +248,7 @@ function advtrains.get_track_connections(name, param2) return nil end --atdebug("Track connections of ",name,param2,":",nodedef.at_conns) - return advtrains.rotate_conn_by(nodedef.at_conns, noderot*AT_CMAX/4), (nodedef.at_rail_y or 0), tracktype + return advtrains.rotate_conn_by(nodedef.at_conns, noderot*AT_CMAX/4), (nodedef.at_rail_y or 0), nodedef.at_conn_map end -- Function called when a track is about to be dug or modified by the trackworker -- cgit v1.2.3