diff options
Diffstat (limited to 'advtrains/advtrains_luaautomation/atc_rail.lua')
-rw-r--r-- | advtrains/advtrains_luaautomation/atc_rail.lua | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/advtrains/advtrains_luaautomation/atc_rail.lua b/advtrains/advtrains_luaautomation/atc_rail.lua index b2a8aad..f52252c 100644 --- a/advtrains/advtrains_luaautomation/atc_rail.lua +++ b/advtrains/advtrains_luaautomation/atc_rail.lua @@ -7,8 +7,14 @@ local r={} function r.fire_event(pos, evtdata) - local ph=minetest.hash_node_position(pos) - local railtbl = atlatc.active.nodes[ph] or {} + local ph=minetest.pos_to_string(pos) + local railtbl = atlatc.active.nodes[ph] + + if not railtbl then + atprint("missing rail table entry!") + return + end + local arrowconn = railtbl.arrowconn @@ -70,7 +76,7 @@ advtrains.register_tracks("default", { atlatc.active.on_receive_fields(pos, ...) --set arrowconn (for ATC) - local ph=minetest.hash_node_position(pos) + local ph=minetest.pos_to_string(pos) local _, conn1=advtrains.get_rail_info_at(pos, advtrains.all_tracktypes) atlatc.active.nodes[ph].arrowconn=conn1 end, |