diff options
author | orwell96 <mono96.mml@gmail.com> | 2017-05-03 16:31:13 +0200 |
---|---|---|
committer | orwell96 <mono96.mml@gmail.com> | 2017-05-03 16:31:13 +0200 |
commit | 28717b4d65dc2e4080d5c7bde799fb4b87ef9a9d (patch) | |
tree | 81511699486ff8130ed23a43622bf73662f2be59 /advtrains/advtrains_luaautomation/active_common.lua | |
parent | 0c7144bcc49449eba9f6ab8f2c1d8efa72b0307a (diff) | |
download | advtrains-28717b4d65dc2e4080d5c7bde799fb4b87ef9a9d.tar.gz advtrains-28717b4d65dc2e4080d5c7bde799fb4b87ef9a9d.tar.bz2 advtrains-28717b4d65dc2e4080d5c7bde799fb4b87ef9a9d.zip |
Performance improvements: Don't clear paths unless absolutely necessary
instead delete path elements that are too far from the train one-by-one
Also when switching a switch or changing rails, only clear train paths of trains that are nearby.
Diffstat (limited to 'advtrains/advtrains_luaautomation/active_common.lua')
-rw-r--r-- | advtrains/advtrains_luaautomation/active_common.lua | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/advtrains/advtrains_luaautomation/active_common.lua b/advtrains/advtrains_luaautomation/active_common.lua index e17af91..8c910c6 100644 --- a/advtrains/advtrains_luaautomation/active_common.lua +++ b/advtrains/advtrains_luaautomation/active_common.lua @@ -49,7 +49,7 @@ function ac.getform(pos, meta_p) end function ac.after_dig_node(pos, node, player) - advtrains.invalidate_all_paths() + advtrains.invalidate_all_paths(pos) advtrains.ndb.clear(pos) local ph=minetest.pos_to_string(pos) ac.nodes[ph]=nil |