aboutsummaryrefslogtreecommitdiff
path: root/advtrains/models/advtrains_track_st.b3d
diff options
context:
space:
mode:
authororwell96 <orwell@bleipb.de>2018-11-10 22:29:01 +0100
committerorwell96 <orwell@bleipb.de>2018-11-10 22:53:12 +0100
commit07fa21f9929d0d36c13aefe83a91b5d250e7fea9 (patch)
tree18a2f2b3d35d8347dca3c8bb3ff17fe16847e735 /advtrains/models/advtrains_track_st.b3d
parentb872bdae82b41398d2322ee848ade2c1cc652ce0 (diff)
downloadadvtrains-07fa21f9929d0d36c13aefe83a91b5d250e7fea9.tar.gz
advtrains-07fa21f9929d0d36c13aefe83a91b5d250e7fea9.tar.bz2
advtrains-07fa21f9929d0d36c13aefe83a91b5d250e7fea9.zip
Increase savefile version to 2
(Master downgrade protection)
Diffstat (limited to 'advtrains/models/advtrains_track_st.b3d')
0 files changed, 0 insertions, 0 deletions
e_pos(parpos) else pos = advtrains.round_vector_floor_y(parpos) end if type(pos)~="table" or (not pos.x or not pos.y or not pos.z) then debug.sethook() error("Invalid position supplied to getstate") end local node=pnode or advtrains.ndb.get_node(pos) local ndef=minetest.registered_nodes[node.name] local st if ndef and ndef.advtrains and ndef.advtrains.getstate then st=ndef.advtrains.getstate elseif ndef and ndef.luaautomation and ndef.luaautomation.getstate then if not deprecation_warned[node.name] then minetest.log("warning", node.name.." uses deprecated definition of ATLATC functions in the 'luaautomation' field. Please move them to the 'advtrains' field!") end st=ndef.luaautomation.getstate else return nil end if type(st)=="function" then return st(pos, node) else return st end end function advtrains.setstate(parpos, newstate, pnode) local pos if atlatc then pos = atlatc.pcnaming.resolve_pos(parpos) else pos = advtrains.round_vector_floor_y(parpos) end if type(pos)~="table" or (not pos.x or not pos.y or not pos.z) then debug.sethook() error("Invalid position supplied to getstate") end local node=pnode or advtrains.ndb.get_node(pos) local ndef=minetest.registered_nodes[node.name] local st if ndef and ndef.advtrains and ndef.advtrains.setstate then st=ndef.advtrains.setstate elseif ndef and ndef.luaautomation and ndef.luaautomation.setstate then if not deprecation_warned[node.name] then minetest.log("warning", node.name.." uses deprecated definition of ATLATC functions in the 'luaautomation' field. Please move them to the 'advtrains' field!") end st=ndef.luaautomation.setstate else return nil end if advtrains.get_train_at_pos(pos) then return false end if advtrains.interlocking and advtrains.interlocking.route.has_route_lock(minetest.pos_to_string(pos)) then return false end st(pos, node, newstate) return true end function advtrains.is_passive(parpos, pnode) local pos if atlatc then pos = atlatc.pcnaming.resolve_pos(parpos) else pos = advtrains.round_vector_floor_y(parpos) end if type(pos)~="table" or (not pos.x or not pos.y or not pos.z) then debug.sethook() error("Invalid position supplied to getstate") end local node=pnode or advtrains.ndb.get_node(pos) local ndef=minetest.registered_nodes[node.name] if ndef and ndef.advtrains and ndef.advtrains.getstate then return true elseif ndef and ndef.luaautomation and ndef.luaautomation.getstate then if not deprecation_warned[node.name] then minetest.log("warning", node.name.." uses deprecated definition of ATLATC functions in the 'luaautomation' field. Please move them to the 'advtrains' field!") end return true else return false end end