make states numbers instead of booleans

This commit is contained in:
Redo0
2021-05-29 13:14:50 -05:00
parent b08c3cd0c4
commit 16c1a9f75f
309 changed files with 2819 additions and 2819 deletions

View File

@@ -27,18 +27,18 @@ datablock fxDtsBrickData(LogicGate_Demux3_Data){
logicInput = "";
logicUpdate =
"return function(gate) " @
" if Gate.getportstate(gate, 12) then " @
" if Gate.getportstate(gate, 12)~=0 then " @
" local idx = 4 + " @
" (bool_to_int[Gate.getportstate(gate, 1)] * 1) + " @
" (bool_to_int[Gate.getportstate(gate, 2)] * 2) + " @
" (bool_to_int[Gate.getportstate(gate, 3)] * 4) " @
" Gate.setportstate(gate, idx, true) " @
" (Gate.getportstate(gate, 1) * 1) + " @
" (Gate.getportstate(gate, 2) * 2) + " @
" (Gate.getportstate(gate, 3) * 4) " @
" Gate.setportstate(gate, idx, 1) " @
" if gate.laston~=idx then " @
" Gate.setportstate(gate, gate.laston, false) " @
" Gate.setportstate(gate, gate.laston, 0) " @
" gate.laston = idx " @
" end " @
" else " @
" Gate.setportstate(gate, gate.laston, false) " @
" Gate.setportstate(gate, gate.laston, 0) " @
" end " @
"end"
;