aboutsummaryrefslogtreecommitdiff
path: root/advtrains/tracks.lua
diff options
context:
space:
mode:
Diffstat (limited to 'advtrains/tracks.lua')
-rw-r--r--advtrains/tracks.lua8
1 files changed, 4 insertions, 4 deletions
diff --git a/advtrains/tracks.lua b/advtrains/tracks.lua
index 99dbb27..8bd5666 100644
--- a/advtrains/tracks.lua
+++ b/advtrains/tracks.lua
@@ -346,17 +346,17 @@ function advtrains.register_tracks(tracktype, def, preset)
end
end
end
- table.insert(advtrains.all_tracktypes, tracktype)
+ advtrains.all_tracktypes[tracktype]=true
end
-function advtrains.is_track_and_drives_on(nodename, drives_on)
+function advtrains.is_track_and_drives_on(nodename, drives_on_p)
if not minetest.registered_nodes[nodename] then
return false
end
local nodedef=minetest.registered_nodes[nodename]
- for k,v in ipairs(drives_on) do
- if nodedef.groups["advtrains_track_"..v] then
+ for k,v in pairs(drives_on_p) do
+ if nodedef.groups["advtrains_track_"..k] then
return true
end
end