aboutsummaryrefslogtreecommitdiff
path: root/advtrains
diff options
context:
space:
mode:
authororwell96 <orwell@bleipb.de>2019-01-21 23:40:09 +0100
committerorwell96 <orwell@bleipb.de>2019-01-21 23:40:09 +0100
commitf705feb4ee023506009fbe5b5eea0d714bff0b86 (patch)
tree736b2a2f8ee3353c4b25cd52c634baa5f5388053 /advtrains
parentf162ebf63f00339dd1b698c051e7b6301bb2c508 (diff)
downloadadvtrains-f705feb4ee023506009fbe5b5eea0d714bff0b86.tar.gz
advtrains-f705feb4ee023506009fbe5b5eea0d714bff0b86.tar.bz2
advtrains-f705feb4ee023506009fbe5b5eea0d714bff0b86.zip
Do not run train steps when path has been deleted
Diffstat (limited to 'advtrains')
-rw-r--r--advtrains/trainlogic.lua4
1 files changed, 2 insertions, 2 deletions
diff --git a/advtrains/trainlogic.lua b/advtrains/trainlogic.lua
index a5323a9..fcf4eb0 100644
--- a/advtrains/trainlogic.lua
+++ b/advtrains/trainlogic.lua
@@ -298,7 +298,7 @@ function advtrains.train_ensure_init(id, train)
end
function advtrains.train_step_b(id, train, dtime)
- if train.no_step or train.wait_for_path then return end
+ if train.no_step or train.wait_for_path or not train.path then return end
-- in this code, we check variables such as path_trk_? and path_dist. We need to ensure that the path is known for the whole 'Train' zone
advtrains.path_get(train, atfloor(train.index + 2))
@@ -473,7 +473,7 @@ function advtrains.train_step_b(id, train, dtime)
end
function advtrains.train_step_c(id, train, dtime)
-if train.no_step or train.wait_for_path then return end
+if train.no_step or train.wait_for_path or not train.path then return end
-- all location/extent-critical actions have been done.
-- calculate the new occupation window