aboutsummaryrefslogtreecommitdiff
path: root/advtrains_interlocking/signal_aspect_accessors.lua
diff options
context:
space:
mode:
authorY. Wang <yw05@forksworld.de>2022-07-03 15:34:42 +0200
committerY. Wang <yw05@forksworld.de>2023-03-23 20:06:02 +0100
commit4a3d442601a800e28a274026392461bd1a7cb127 (patch)
tree0159f31dbb2e51daf29c0844a5eb36790f1d754d /advtrains_interlocking/signal_aspect_accessors.lua
parent875968f078ef89b13afae6d02a2dabe5ea7897cb (diff)
downloadadvtrains-4a3d442601a800e28a274026392461bd1a7cb127.tar.gz
advtrains-4a3d442601a800e28a274026392461bd1a7cb127.tar.bz2
advtrains-4a3d442601a800e28a274026392461bd1a7cb127.zip
Reduce number of set_aspect calls
Diffstat (limited to 'advtrains_interlocking/signal_aspect_accessors.lua')
-rw-r--r--advtrains_interlocking/signal_aspect_accessors.lua4
1 files changed, 2 insertions, 2 deletions
diff --git a/advtrains_interlocking/signal_aspect_accessors.lua b/advtrains_interlocking/signal_aspect_accessors.lua
index bdbb803..e23aa13 100644
--- a/advtrains_interlocking/signal_aspect_accessors.lua
+++ b/advtrains_interlocking/signal_aspect_accessors.lua
@@ -95,7 +95,7 @@ get_aspect = function(pos)
return asp
end
-local function set_aspect(pos, asp)
+local function set_aspect(pos, asp, skipdst)
local node = N.get_node(pos)
local ndef = minetest.registered_nodes[node.name]
if ndef and ndef.advtrains and ndef.advtrains.set_aspect then
@@ -105,7 +105,7 @@ local function set_aspect(pos, asp)
ndef.advtrains.set_aspect(pos, node, aspval)
I.signal_on_aspect_changed(pos)
local aspect_changed = A.not_equalp(oldasp, newasp)
- if aspect_changed then
+ if (not skipdst) and aspect_changed then
D.update_main(pos)
end
end