You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: mesecons/internal.lua
+35-48
Original file line number
Diff line number
Diff line change
@@ -39,7 +39,7 @@
39
39
-- mesecon.is_power_off(pos) --> Returns true if pos does not emit power in any way
40
40
-- mesecon.turnon(pos, rulename) --> Returns true whatever there is at pos. Calls itself for connected nodes (if pos is a conductor) --> recursive, the rulename is the name of the input rule that caused calling turnon; Uses third parameter recdepth internally to determine how far away the current node is from the initial pos as it uses recursion
41
41
-- mesecon.turnoff(pos, rulename) --> Turns off whatever there is at pos. Calls itself for connected nodes (if pos is a conductor) --> recursive, the rulename is the name of the input rule that caused calling turnoff; Uses third parameter recdepth internally to determine how far away the current node is from the initial pos as it uses recursion
42
-
-- mesecon.connected_to_receptor(pos) --> Returns true if pos is connected to a receptor directly or via conductors; calls itself if pos is a conductor --> recursive
42
+
-- mesecon.connected_to_receptor(pos, link) --> Returns true if pos is connected to a receptor directly or via conductors; calls itself if pos is a conductor --> recursive
43
43
-- mesecon.rules_link(output, input, dug_outputrules) --> Returns true if outputposition + outputrules = inputposition and inputposition + inputrules = outputposition (if the two positions connect)
44
44
-- mesecon.rules_link_anydir(outp., inp., d_outpr.) --> Same as rules mesecon.rules_link but also returns true if output and input are swapped
45
45
-- mesecon.is_powered(pos) --> Returns true if pos is powered by a receptor or a conductor
@@ -179,8 +179,8 @@ end
179
179
180
180
-- Activation:
181
181
mesecon.queue:add_function("activate", function (pos, rulename)
182
-
node=minetest.get_node(pos)
183
-
effector=mesecon.get_effector(node.name)
182
+
localnode=minetest.get_node(pos)
183
+
localeffector=mesecon.get_effector(node.name)
184
184
185
185
ifeffectorandeffector.action_onthen
186
186
effector.action_on(pos, node, rulename)
@@ -446,18 +446,18 @@ mesecon.queue:add_function("turnoff", function (pos, rulename, recdepth)
functionmesecon.rules_link(output, input, dug_outputrules) --output/input are positions (outputrules optional, used if node has been dug), second return value: the name of the affected input rule
@@ -551,7 +538,7 @@ function mesecon.rules_link_rule_all(output, rule)
551
538
ifmesecon.cmpPos(mesecon.addPosRule(input, inputrule), output) then
552
539
ifinputrule.sx==nilorrule.sx==nil
553
540
ormesecon.cmpSpecial(inputrule, rule) then
554
-
rules[#rules+1] =inputrule
541
+
table.insert(rules, inputrule)
555
542
end
556
543
end
557
544
end
@@ -572,7 +559,7 @@ function mesecon.rules_link_rule_all_inverted(input, rule)
572
559
ifmesecon.cmpPos(mesecon.addPosRule(output, outputrule), input) then
0 commit comments