diff options
Diffstat (limited to 'advtrains')
-rw-r--r-- | advtrains/api_doc.txt | 3 | ||||
-rw-r--r-- | advtrains/trainlogic.lua | 2 |
2 files changed, 5 insertions, 0 deletions
diff --git a/advtrains/api_doc.txt b/advtrains/api_doc.txt index 6b338a7..faaac7c 100644 --- a/advtrains/api_doc.txt +++ b/advtrains/api_doc.txt @@ -72,6 +72,9 @@ advtrains.register_wagon(name, prototype, description, inventory_image) ^- optional. If defined, defines the locations of the doors on the model as distance from the object center on the path. ^- Getting on by walking in then takes effect. ^- Positive values mean front, negative ones back. Resulting position is automatically shifted to the right side. + door_operation_time = 2 + ^- Time in seconds specifying how long opening/closing the doors takes. The maximum of this value is used + ^- by the stop rail (and possibly ATC) to wait for closing the doors before departure. Default is 1 second. coupler_types_front = {scharfenberg=true}, coupler_types_back = {chain=true}, diff --git a/advtrains/trainlogic.lua b/advtrains/trainlogic.lua index c0ac179..559c029 100644 --- a/advtrains/trainlogic.lua +++ b/advtrains/trainlogic.lua @@ -1048,6 +1048,7 @@ function advtrains.update_trainpart_properties(train_id, invert_flipstate) --FIX: deep-copy the table!!! train.max_speed=20 train.extent_h = 0; + train.door_operation_time = 1 local rel_pos=0 local count_l=0 @@ -1088,6 +1089,7 @@ function advtrains.update_trainpart_properties(train_id, invert_flipstate) train.max_speed=math.min(train.max_speed, wagon.max_speed) train.extent_h = math.max(train.extent_h, wagon.extent_h or 1); + train.door_operation_time = math.max(train.door_operation_time, wagon.door_operation_time or 2) end end train.trainlen = rel_pos |