From ad82b9cd4e12e16a176a2af08d480fa939076515 Mon Sep 17 00:00:00 2001 From: orwell Date: Sun, 15 Oct 2023 15:06:20 +0200 Subject: Forget it, and use the old preset tables for track registration. Just adapt it to the new definition. --- advtrains/tracks.lua | 24 ++++-------------------- 1 file changed, 4 insertions(+), 20 deletions(-) (limited to 'advtrains/tracks.lua') diff --git a/advtrains/tracks.lua b/advtrains/tracks.lua index 46ceaf8..1abef59 100644 --- a/advtrains/tracks.lua +++ b/advtrains/tracks.lua @@ -222,19 +222,6 @@ function advtrains.register_node_4rot(ori_name, ori_ndef, definition_mangling_fu end end - --- Registers an item to place and automatically connect nearby tracks -function advtrains.register_track_placer(...) - -end - --- Registers an item to place and adjust slope tracks -function advtrains.register_slope_placer(...) - -end - - - -- track-related helper functions function advtrains.is_track(nodename) @@ -255,13 +242,10 @@ function advtrains.get_track_connections(name, param2) if not param2 then noderot=0 end if noderot > 3 then atprint(" get_track_connections: rail has invaild param2 of "..noderot) noderot=0 end - local tracktype - for k,_ in pairs(nodedef.groups) do - local tt=string.match(k, "^advtrains_track_(.+)$") - if tt then - tracktype=tt - end + if not nodedef.at_conns then + 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 end @@ -283,4 +267,4 @@ function advtrains.can_dig_or_modify_track(pos) end end return true -end \ No newline at end of file +end -- cgit v1.2.3