update logic functions to remove metatable OOP

This commit is contained in:
Redo
2020-09-10 12:58:25 -05:00
parent 4095d193ff
commit ab19de7333
206 changed files with 22726 additions and 3544 deletions

View File

@@ -27,18 +27,18 @@ datablock fxDtsBrickData(LogicGate_Demux3_Data){
logicInput = "";
logicUpdate =
"return function(gate) " @
" if gate.ports[12].state then " @
" if Gate.getportstate(gate, 12) then " @
" local idx = 4 + " @
" (gate.ports[1].state and 1 or 0) + " @
" (gate.ports[2].state and 2 or 0) + " @
" (gate.ports[3].state and 4 or 0) " @
" gate.ports[idx]:setstate(true) " @
" (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) " @
" if gate.laston~=idx then " @
" gate.ports[gate.laston]:setstate(false) " @
" Gate.setportstate(gate, gate.laston, false) " @
" gate.laston = idx " @
" end " @
" else " @
" gate.ports[gate.laston]:setstate(false) " @
" Gate.setportstate(gate, gate.laston, false) " @
" end " @
"end"
;