From 182e7ab96b1bab977b20123c7c2f500ed364f72f Mon Sep 17 00:00:00 2001 From: DS-Minetest Date: Tue, 3 Oct 2017 16:43:10 +0200 Subject: [PATCH] use ifs again --- mesecons_fpga/init.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/mesecons_fpga/init.lua b/mesecons_fpga/init.lua index aea844e..0f4e091 100644 --- a/mesecons_fpga/init.lua +++ b/mesecons_fpga/init.lua @@ -142,7 +142,11 @@ plg.register_nodes({ if o and o.type == "io" then local num = abcd2[o.port] num = num + dir - num = (2 ^ num % 2) * 4 + num - math.floor(num / 5) * 4 + if num > 4 then + num = 1 + elseif num < 1 then + num = 4 + end instr[i][op].port = abcd1[num] end end