make states numbers instead of booleans
This commit is contained in:
@@ -23,7 +23,7 @@ datablock fxDtsBrickData(LogicGate_Rom4x4_Data){
|
||||
"return function(gate) " @
|
||||
" gate.romdata = {} " @
|
||||
" for i = 0, 15 do " @
|
||||
" gate.romdata[i] = false " @
|
||||
" gate.romdata[i] = 0 " @
|
||||
" end " @
|
||||
"end"
|
||||
;
|
||||
@@ -32,7 +32,7 @@ datablock fxDtsBrickData(LogicGate_Rom4x4_Data){
|
||||
" local data = args[1] " @
|
||||
" for i = 1, #data do " @
|
||||
" local c = data:sub(i, i) " @
|
||||
" gate.romdata[i-1] = (c==\"1\") " @
|
||||
" gate.romdata[i-1] = (c==\"1\") and 1 or 0 " @
|
||||
" end " @
|
||||
" Gate.queue(gate, 0) " @
|
||||
"end"
|
||||
@@ -41,13 +41,13 @@ datablock fxDtsBrickData(LogicGate_Rom4x4_Data){
|
||||
"return function(gate) " @
|
||||
" if Gate.getportstate(gate, 6) then " @
|
||||
" Gate.setportstate(gate, 5, gate.romdata[( " @
|
||||
" (Gate.getportstate(gate, 1) and 1 or 0) " @
|
||||
" + (Gate.getportstate(gate, 2) and 2 or 0) " @
|
||||
" + (Gate.getportstate(gate, 3) and 4 or 0) " @
|
||||
" + (Gate.getportstate(gate, 4) and 8 or 0) " @
|
||||
" (Gate.getportstate(gate, 1)) " @
|
||||
" + (Gate.getportstate(gate, 2) * 2) " @
|
||||
" + (Gate.getportstate(gate, 3) * 4) " @
|
||||
" + (Gate.getportstate(gate, 4) * 8) " @
|
||||
" )]) " @
|
||||
" else " @
|
||||
" Gate.setportstate(gate, 5, false) " @
|
||||
" Gate.setportstate(gate, 5, 0) " @
|
||||
" end " @
|
||||
"end"
|
||||
;
|
||||
|
||||
Reference in New Issue
Block a user