aboutsummaryrefslogtreecommitdiff
path: root/advtrains/nodedb.lua
diff options
context:
space:
mode:
authorY. Wang <y5nw@protonmail.com>2024-09-16 00:43:27 +0200
committerY. Wang <y5nw@protonmail.com>2024-09-16 00:43:27 +0200
commitc7ff2958a67b1ce0c0bebae91cc56b5da60b1878 (patch)
treeb312006debfde3cfc811fe089a8228f9a5cbf4ff /advtrains/nodedb.lua
parentb5d2c23b3266299c78230ccc71a055e2c1ae00fa (diff)
downloadadvtrains-c7ff2958a67b1ce0c0bebae91cc56b5da60b1878.tar.gz
advtrains-c7ff2958a67b1ce0c0bebae91cc56b5da60b1878.tar.bz2
advtrains-c7ff2958a67b1ce0c0bebae91cc56b5da60b1878.zip
More tracy wrappers for path/LZB-related functionstracy
Diffstat (limited to 'advtrains/nodedb.lua')
-rw-r--r--advtrains/nodedb.lua8
1 files changed, 7 insertions, 1 deletions
diff --git a/advtrains/nodedb.lua b/advtrains/nodedb.lua
index 41ac089..51f0e24 100644
--- a/advtrains/nodedb.lua
+++ b/advtrains/nodedb.lua
@@ -269,17 +269,23 @@ end
--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)
+ tracy.ZoneBegin("advtrains.get_rail_info_at")
local rdp=advtrains.round_vector_floor_y(pos)
local node=ndb.get_node_or_nil(rdp)
- if not node then return end
+ if not node then
+ tracy.ZoneEnd()
+ return
+ end
local nodename=node.name
if(not advtrains.is_track_and_drives_on(nodename, drives_on)) then
+ tracy.ZoneEnd()
return false
end
local conns, railheight, tracktype=advtrains.get_track_connections(node.name, node.param2)
+ tracy.ZoneEnd()
return true, conns, railheight
end