aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--advtrains_luaautomation/environment.lua4
1 files changed, 4 insertions, 0 deletions
diff --git a/advtrains_luaautomation/environment.lua b/advtrains_luaautomation/environment.lua
index 50eca7c..4d4ac47 100644
--- a/advtrains_luaautomation/environment.lua
+++ b/advtrains_luaautomation/environment.lua
@@ -161,6 +161,10 @@ local static_env = {
if not train then return false end
return table.copy(train.trainparts or {})
end,
+ get_wagon_train_id = function(wagon_id)
+ local wagon = advtrains.wagons[wagon_id]
+ return wagon and wagon.train_id or false
+ end,
-- sends an atc command to train regardless of where it is in the world
atc_send_to_train = function(train_id, command)
assertt(command, "string")