diff options
author | Singularis <singularis@volny.cz> | 2025-04-21 07:21:53 +0200 |
---|---|---|
committer | orwell <orwell@bleipb.de> | 2025-05-27 20:22:01 +0200 |
commit | 95a5586e0fe196e2291acaf128b8d1b4f8a32510 (patch) | |
tree | 6cc5ff9a64e533c8d9262f965e2246dfa2b3da24 /advtrains/nodedb.lua | |
parent | 1d6913cec797b3848c93e8c6b16c3b6b2711d38c (diff) | |
download | advtrains-95a5586e0fe196e2291acaf128b8d1b4f8a32510.tar.gz advtrains-95a5586e0fe196e2291acaf128b8d1b4f8a32510.tar.bz2 advtrains-95a5586e0fe196e2291acaf128b8d1b4f8a32510.zip |
[advtrains] přechod na Advtrains 2.5.0 (první pokus)
- [ch_core/lib] drobná oprava
- [advtrains_attachment_offset_patch] použití initial_properties
Diffstat (limited to 'advtrains/nodedb.lua')
-rw-r--r-- | advtrains/nodedb.lua | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/advtrains/nodedb.lua b/advtrains/nodedb.lua index b6521d5..408ff5d 100644 --- a/advtrains/nodedb.lua +++ b/advtrains/nodedb.lua @@ -212,6 +212,10 @@ function ndb.get_node(pos) end return n end +function ndb.get_ndef(pos) + local n=ndb.get_node_or_nil(pos) + return n and minetest.registered_nodes[n.name] +end function ndb.get_node_raw(pos) local cid=ndbget(pos.x, pos.y, pos.z) if cid then @@ -264,23 +268,23 @@ end --get_node with pseudoload. now we only need track data, so we can use the trackdb as second fallback --nothing new will be saved inside the trackdb. --returns: ---true, conn1, conn2, rely1, rely2, railheight in case everything's right. +--true, conns, railheight, connmap in case everything's right. --false if it's not a rail or the train does not drive on this rail, but it is loaded or --nil if the node is neither loaded nor in trackdb --the distraction between false and nil will be needed only in special cases.(train initpos) -function advtrains.get_rail_info_at(pos, drives_on) +function advtrains.get_rail_info_at(pos) local rdp=advtrains.round_vector_floor_y(pos) local node=ndb.get_node_or_nil(rdp) if not node then return end local nodename=node.name - if(not advtrains.is_track_and_drives_on(nodename, drives_on)) then + if(not advtrains.is_track(nodename)) then return false end - local conns, railheight, tracktype=advtrains.get_track_connections(node.name, node.param2) + local conns, railheight, connmap = advtrains.get_track_connections(node.name, node.param2) - return true, conns, railheight + return true, conns, railheight, connmap end local IGNORE_WORLD = advtrains.IGNORE_WORLD |