add train_length command to luaatc

master
Gabriel Pérez-Cerezo 2020-07-27 21:50:22 +02:00
parent 45413ee5c0
commit 549db4737f
1 changed files with 7 additions and 0 deletions

View File

@ -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)