make states numbers instead of booleans
This commit is contained in:
@@ -27,21 +27,21 @@ datablock fxDtsBrickData(LogicGate_Demux6_Data){
|
||||
logicInput = "";
|
||||
logicUpdate =
|
||||
"return function(gate) " @
|
||||
" if Gate.getportstate(gate, 71) then " @
|
||||
" if Gate.getportstate(gate, 71)~=0 then " @
|
||||
" local idx = 7 + " @
|
||||
" (bool_to_int[Gate.getportstate(gate, 1)] * 1) + " @
|
||||
" (bool_to_int[Gate.getportstate(gate, 2)] * 2) + " @
|
||||
" (bool_to_int[Gate.getportstate(gate, 3)] * 4) + " @
|
||||
" (bool_to_int[Gate.getportstate(gate, 4)] * 8) + " @
|
||||
" (bool_to_int[Gate.getportstate(gate, 5)] * 16) + " @
|
||||
" (bool_to_int[Gate.getportstate(gate, 6)] * 32) " @
|
||||
" Gate.setportstate(gate, idx, true) " @
|
||||
" (Gate.getportstate(gate, 1) * 1) + " @
|
||||
" (Gate.getportstate(gate, 2) * 2) + " @
|
||||
" (Gate.getportstate(gate, 3) * 4) + " @
|
||||
" (Gate.getportstate(gate, 4) * 8) + " @
|
||||
" (Gate.getportstate(gate, 5) * 16) + " @
|
||||
" (Gate.getportstate(gate, 6) * 32) " @
|
||||
" 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"
|
||||
;
|
||||
|
||||
Reference in New Issue
Block a user