aboutsummaryrefslogtreecommitdiff
path: root/advtrains/trainlogic.lua
diff options
context:
space:
mode:
authororwell96 <orwell@bleipb.de>2020-06-12 12:32:46 +0200
committerorwell96 <orwell@bleipb.de>2021-02-10 16:36:24 +0100
commit61329c11a28ca0d68f95f189d3a66c373d7dddc3 (patch)
tree8e57504f17c86efdadf2b8494e3427e4f947a001 /advtrains/trainlogic.lua
parentd3b2f614be059e65869a615fe319118c0a354995 (diff)
downloadadvtrains-61329c11a28ca0d68f95f189d3a66c373d7dddc3.tar.gz
advtrains-61329c11a28ca0d68f95f189d3a66c373d7dddc3.tar.bz2
advtrains-61329c11a28ca0d68f95f189d3a66c373d7dddc3.zip
Start using path_invalidate_ahead()
Diffstat (limited to 'advtrains/trainlogic.lua')
-rw-r--r--advtrains/trainlogic.lua12
1 files changed, 12 insertions, 0 deletions
diff --git a/advtrains/trainlogic.lua b/advtrains/trainlogic.lua
index bb1e1b9..3870ef6 100644
--- a/advtrains/trainlogic.lua
+++ b/advtrains/trainlogic.lua
@@ -1277,6 +1277,18 @@ function advtrains.invalidate_all_paths(pos)
advtrains.invalidate_path(id)
end
end
+
+-- Calls invalidate_path_ahead on all trains occupying (having paths over) this node
+-- Can be called during train step.
+function advtrains.invalidate_all_paths_ahead(pos)
+ local tab = advtrains.occ.get_trains_over(pos)
+
+ for id,index in pairs(tab) do
+ local train = advtrains.trains[id]
+ advtrains.path_invalidate_ahead(train, index, true)
+ end
+end
+
function advtrains.invalidate_path(id)
--atdebug("Path invalidate:",id)
local v=advtrains.trains[id]