aboutsummaryrefslogtreecommitdiff
path: root/advtrains_interlocking/signal_api.lua
diff options
context:
space:
mode:
authororwell96 <orwell@bleipb.de>2018-10-29 18:12:00 +0100
committerorwell96 <orwell@bleipb.de>2018-10-29 18:12:00 +0100
commit0ae0b6a768ebb33d3835875e3a3b5dc30379c92b (patch)
tree035d9b03f2c72cf51c104192fe4b6a8515f2e70f /advtrains_interlocking/signal_api.lua
parent9f6ae55e37141e8e446e6229132495e69b0e31ad (diff)
downloadadvtrains-0ae0b6a768ebb33d3835875e3a3b5dc30379c92b.tar.gz
advtrains-0ae0b6a768ebb33d3835875e3a3b5dc30379c92b.tar.bz2
advtrains-0ae0b6a768ebb33d3835875e3a3b5dc30379c92b.zip
Fix signal_get_aspect()
Had a series of bugs as result, like auto-clearing IPs and not-working lzb
Diffstat (limited to 'advtrains_interlocking/signal_api.lua')
-rw-r--r--advtrains_interlocking/signal_api.lua5
1 files changed, 3 insertions, 2 deletions
diff --git a/advtrains_interlocking/signal_api.lua b/advtrains_interlocking/signal_api.lua
index 9238587..021cbfd 100644
--- a/advtrains_interlocking/signal_api.lua
+++ b/advtrains_interlocking/signal_api.lua
@@ -287,7 +287,7 @@ function advtrains.interlocking.signal_get_supposed_aspect(pos)
end
-- Returns the actual aspect of the signal at position, as returned by the nodedef.
--- returns nil
+-- returns nil when there's no signal at the position
function advtrains.interlocking.signal_get_aspect(pos)
local node=advtrains.ndb.get_node(pos)
local ndef=minetest.registered_nodes[node.name]
@@ -295,8 +295,9 @@ function advtrains.interlocking.signal_get_aspect(pos)
local asp = ndef.advtrains.get_aspect(pos, node)
if not asp then asp = DANGER end
fillout_aspect(asp)
- return
+ return asp
end
+ return nil
end
local players_assign_ip = {}