aboutsummaryrefslogtreecommitdiff
path: root/advtrains_luaautomation/atc_rail.lua
diff options
context:
space:
mode:
authorGabriel Pérez-Cerezo <gabriel@gpcf.eu>2020-08-21 15:58:12 +0200
committerGabriel Pérez-Cerezo <gabriel@gpcf.eu>2020-08-21 15:58:12 +0200
commitb23d346ace0219b1e6c61b85f4a06a90d3a0e962 (patch)
treee4f6ec40b9a0c999bb42f13e608e89b943381d7a /advtrains_luaautomation/atc_rail.lua
parent36d8c8b7162b3b6ba6cc0a7f98b0dc295024ecd8 (diff)
downloadadvtrains-b23d346ace0219b1e6c61b85f4a06a90d3a0e962.tar.gz
advtrains-b23d346ace0219b1e6c61b85f4a06a90d3a0e962.tar.bz2
advtrains-b23d346ace0219b1e6c61b85f4a06a90d3a0e962.zip
add maximum length parameter to split_at_fc and split_off_locomotive
Diffstat (limited to 'advtrains_luaautomation/atc_rail.lua')
-rw-r--r--advtrains_luaautomation/atc_rail.lua8
1 files changed, 4 insertions, 4 deletions
diff --git a/advtrains_luaautomation/atc_rail.lua b/advtrains_luaautomation/atc_rail.lua
index 758b8f9..6083dfc 100644
--- a/advtrains_luaautomation/atc_rail.lua
+++ b/advtrains_luaautomation/atc_rail.lua
@@ -66,19 +66,19 @@ function r.fire_event(pos, evtdata)
end
return false
end,
- split_at_fc = function(cmd)
+ split_at_fc = function(cmd, len)
assertt(cmd, "string")
if not train_id then return false end
- local new_id, fc = advtrains.split_train_at_fc(train)
+ local new_id, fc = advtrains.split_train_at_fc(train, false, len)
if new_id then
minetest.after(1,advtrains.atc.train_set_command,advtrains.trains[new_id], cmd, atc_arrow)
end
return fc or ""
end,
- split_off_locomotive = function(cmd)
+ split_off_locomotive = function(cmd, len)
assertt(cmd, "string")
if not train_id then return false end
- local new_id, fc = advtrains.split_train_at_fc(train, true)
+ local new_id, fc = advtrains.split_train_at_fc(train, true, len)
if new_id then
minetest.after(1,advtrains.atc.train_set_command,advtrains.trains[new_id], cmd, atc_arrow)
end