add limiter, simplify filter code

This commit is contained in:
OgelGames
2021-01-24 17:55:47 +11:00
parent 474fa1bfb8
commit a285363c92
5 changed files with 66 additions and 14 deletions
+5 -11
View File
@@ -28,19 +28,13 @@ minetest.register_node("digicontrol:filter", {
end,
digiline = {
semiconductor = {
rules = function(node, pos, from, channel)
rules = function(node, pos, _, channel)
local setchannel = minetest.get_meta(pos):get_string("channel")
if channel ~= setchannel then return {} end
local side = digicontrol.get_side(pos, from, node.param2)
if side == 3 then
return {
digicontrol.get_rule(1, node.param2)
}
else
return {
digicontrol.get_rule(3, node.param2)
}
end
return {
digicontrol.get_rule(1, node.param2),
digicontrol.get_rule(3, node.param2)
}
end
},
wire = {