aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--advtrains_luaautomation/atc_rail.lua7
1 files changed, 7 insertions, 0 deletions
diff --git a/advtrains_luaautomation/atc_rail.lua b/advtrains_luaautomation/atc_rail.lua
index 04e2f85..88203ae 100644
--- a/advtrains_luaautomation/atc_rail.lua
+++ b/advtrains_luaautomation/atc_rail.lua
@@ -73,8 +73,15 @@ function r.fire_event(pos, evtdata)
if new_id then
minetest.after(1,advtrains.atc.train_set_command,advtrains.trains[new_id], cmd, atc_arrow)
end
+ if fc == "" then
+ return nil
+ end
return fc
end,
+ train_length = function ()
+ if not train_id then return false end
+ return #train.trainparts
+ end,
step_fc = function()
if not train_id then return false end
advtrains.train_step_fc(train)