aboutsummaryrefslogtreecommitdiff
path: root/advtrains/tracks.lua
diff options
context:
space:
mode:
authororwell <orwell@bleipb.de>2023-10-15 15:06:20 +0200
committerorwell <orwell@bleipb.de>2023-10-15 15:06:20 +0200
commitad82b9cd4e12e16a176a2af08d480fa939076515 (patch)
tree48bb80c1fb78c2befe7b9a3c242e67e9d9cd97a6 /advtrains/tracks.lua
parent10ea9b896b140ecc5ed4e53e7ee1daeaa4efa46e (diff)
downloadadvtrains-ad82b9cd4e12e16a176a2af08d480fa939076515.tar.gz
advtrains-ad82b9cd4e12e16a176a2af08d480fa939076515.tar.bz2
advtrains-ad82b9cd4e12e16a176a2af08d480fa939076515.zip
Forget it, and use the old preset tables for track registration. Just adapt it to the new definition.
Diffstat (limited to 'advtrains/tracks.lua')
-rw-r--r--advtrains/tracks.lua24
1 files changed, 4 insertions, 20 deletions
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