From f705feb4ee023506009fbe5b5eea0d714bff0b86 Mon Sep 17 00:00:00 2001 From: orwell96 Date: Mon, 21 Jan 2019 23:40:09 +0100 Subject: Do not run train steps when path has been deleted --- advtrains/trainlogic.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'advtrains') 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 -- cgit v1.2.3