aboutsummaryrefslogtreecommitdiff
path: root/advtrains/trainlogic.lua
diff options
context:
space:
mode:
authororwell96 <orwell@bleipb.de>2019-01-22 12:26:31 +0100
committerorwell96 <orwell@bleipb.de>2019-01-22 12:26:31 +0100
commit240e7dd091c6c66ae6cdade3d9f4099756f60916 (patch)
tree10284f47875748d9c7047992731ad143a6f34e14 /advtrains/trainlogic.lua
parente2ae763dba3f7f609eccd9b8dd378304fad24b0d (diff)
downloadadvtrains-240e7dd091c6c66ae6cdade3d9f4099756f60916.tar.gz
advtrains-240e7dd091c6c66ae6cdade3d9f4099756f60916.tar.bz2
advtrains-240e7dd091c6c66ae6cdade3d9f4099756f60916.zip
Warn when something clears the path winthin train step
Diffstat (limited to 'advtrains/trainlogic.lua')
-rw-r--r--advtrains/trainlogic.lua9
1 files changed, 8 insertions, 1 deletions
diff --git a/advtrains/trainlogic.lua b/advtrains/trainlogic.lua
index 9c214bb..ff9abf4 100644
--- a/advtrains/trainlogic.lua
+++ b/advtrains/trainlogic.lua
@@ -83,6 +83,8 @@ advtrains.mainloop_trainlogic=function(dtime)
advtrains.train_ensure_init(k, v)
end
+ advtrains.lock_path_inval = true
+
for k,v in pairs(advtrains.trains) do
advtrains.atprint_context_tid=k
advtrains.train_step_b(k, v, dtime)
@@ -93,6 +95,8 @@ advtrains.mainloop_trainlogic=function(dtime)
advtrains.train_step_c(k, v, dtime)
end
+ advtrains.lock_path_inval = false
+
advtrains.atprint_context_tid=nil
atprintbm("trainsteps", t)
@@ -1039,7 +1043,7 @@ function advtrains.invert_train(train_id)
train.atc_arrow = not train.atc_arrow
end
- advtrains.path_invalidate(train)
+ advtrains.path_invalidate(train, true)
advtrains.couple_invalidate(train)
local old_trainparts=train.trainparts
@@ -1049,6 +1053,9 @@ function advtrains.invert_train(train_id)
end
advtrains.update_trainpart_properties(train_id, true)
+ -- recalculate path
+ advtrains.train_ensure_init(train_id, train)
+
-- If interlocking present, check whether this train is in a section and then set as shunt move after reversion
if advtrains.interlocking and train.il_sections and #train.il_sections > 0 then
train.is_shunt = true