aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--advtrains/trainlogic.lua11
1 files changed, 11 insertions, 0 deletions
diff --git a/advtrains/trainlogic.lua b/advtrains/trainlogic.lua
index d83d89f..187e5ba 100644
--- a/advtrains/trainlogic.lua
+++ b/advtrains/trainlogic.lua
@@ -1106,6 +1106,17 @@ function advtrains.split_train_at_index(train, index)
local newtrain=advtrains.trains[newtrain_id]
newtrain.velocity=train.velocity
+ -- copy various properties from the old to the new train
+ newtrain.door_open = train.door_open
+ newtrain.text_outside = train.text_outside
+ newtrain.text_inside = train.text_inside
+ newtrain.line = train.line
+ newtrain.routingcode = train.routingcode
+ newtrain.speed_restriction = train.speed_restriction
+ newtrain.is_shunt = train.is_shunt
+ newtrain.points_split = advtrains.merge_tables(train.points_split)
+ newtrain.autocouple = train.autocouple
+
return newtrain_id -- return new train ID, so new train can be manipulated
end