make states numbers instead of booleans
This commit is contained in:
@@ -23,7 +23,7 @@ datablock fxDtsBrickData(LogicGate_Rom32x32_Data){
|
||||
"return function(gate) " @
|
||||
" gate.romdata = {} " @
|
||||
" for i = 0, 1023 do " @
|
||||
" gate.romdata[i] = false " @
|
||||
" gate.romdata[i] = 0 " @
|
||||
" end " @
|
||||
"end"
|
||||
;
|
||||
@@ -32,7 +32,7 @@ datablock fxDtsBrickData(LogicGate_Rom32x32_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,19 +41,19 @@ datablock fxDtsBrickData(LogicGate_Rom32x32_Data){
|
||||
"return function(gate) " @
|
||||
" if Gate.getportstate(gate, 12) then " @
|
||||
" Gate.setportstate(gate, 11, 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, 5) and 16 or 0) " @
|
||||
" + (Gate.getportstate(gate, 6) and 32 or 0) " @
|
||||
" + (Gate.getportstate(gate, 7) and 64 or 0) " @
|
||||
" + (Gate.getportstate(gate, 8) and 128 or 0) " @
|
||||
" + (Gate.getportstate(gate, 9) and 256 or 0) " @
|
||||
" + (Gate.getportstate(gate, 10) and 512 or 0) " @
|
||||
" (Gate.getportstate(gate, 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.getportstate(gate, 7) * 64) " @
|
||||
" + (Gate.getportstate(gate, 8) * 128) " @
|
||||
" + (Gate.getportstate(gate, 9) * 256) " @
|
||||
" + (Gate.getportstate(gate, 10) * 512) " @
|
||||
" )]) " @
|
||||
" else " @
|
||||
" Gate.setportstate(gate, 11, false) " @
|
||||
" Gate.setportstate(gate, 11, 0) " @
|
||||
" end " @
|
||||
"end"
|
||||
;
|
||||
|
||||
Reference in New Issue
Block a user