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,16 +27,16 @@ datablock fxDtsBrickData(LogicGate_Demux1_Data){
logicInput = "";
logicUpdate =
"return function(gate) " @
" if gate.ports[4].state then " @
" if Gate.getportstate(gate, 4) then " @
" local idx = 2 + " @
" (gate.ports[1].state and 1 or 0) " @
" gate.ports[idx]:setstate(true) " @
" (bool_to_int[Gate.getportstate(gate, 1)] * 1) " @
" 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"
;