make input queue stack again
This commit is contained in:
parent
7109dd70a2
commit
bcc39d9f20
@ -185,7 +185,7 @@ function Group.setstate(group, state)
|
|||||||
local len = group.num_gates_update
|
local len = group.num_gates_update
|
||||||
for i = 1, len do
|
for i = 1, len do
|
||||||
local gate = group.gates_update[i]
|
local gate = group.gates_update[i]
|
||||||
if gate.in_queue==0 then
|
if gate and gate.in_queue==0 then
|
||||||
Simulation.queuegate(sim, gate)
|
Simulation.queuegate(sim, gate)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -55,6 +55,8 @@ GSim = sim
|
|||||||
network_accept_client()
|
network_accept_client()
|
||||||
|
|
||||||
while true do
|
while true do
|
||||||
|
network_update()
|
||||||
|
|
||||||
local time = os.clock()
|
local time = os.clock()
|
||||||
|
|
||||||
if OPT_TICK_ENABLED then
|
if OPT_TICK_ENABLED then
|
||||||
@ -84,8 +86,6 @@ while true do
|
|||||||
end
|
end
|
||||||
|
|
||||||
if time-lastfxtime >= OPT_FX_TIME then
|
if time-lastfxtime >= OPT_FX_TIME then
|
||||||
network_update()
|
|
||||||
|
|
||||||
if OPT_FX_UPDATES then
|
if OPT_FX_UPDATES then
|
||||||
Simulation.sendfxupdate(sim)
|
Simulation.sendfxupdate(sim)
|
||||||
end
|
end
|
||||||
|
@ -263,7 +263,9 @@ end
|
|||||||
|
|
||||||
function Simulation.queuegateinput(sim, gate, argv)
|
function Simulation.queuegateinput(sim, gate, argv)
|
||||||
sim.inputqueue = sim.inputqueue or {}
|
sim.inputqueue = sim.inputqueue or {}
|
||||||
sim.inputqueue[gate] = argv
|
--sim.inputqueue[gate] = argv
|
||||||
|
sim.inputqueue[gate] = sim.inputqueue[gate] or {}
|
||||||
|
table.insert(sim.inputqueue[gate], argv)
|
||||||
end
|
end
|
||||||
|
|
||||||
function Simulation.queuegateinit(sim, gate)
|
function Simulation.queuegateinit(sim, gate)
|
||||||
@ -358,8 +360,10 @@ end
|
|||||||
|
|
||||||
function Simulation.tickinput(sim)
|
function Simulation.tickinput(sim)
|
||||||
if sim.inputqueue ~= nil then
|
if sim.inputqueue ~= nil then
|
||||||
for gate, argv in pairs(sim.inputqueue) do
|
for gate, inputs in pairs(sim.inputqueue) do
|
||||||
Gate.input(gate, argv)
|
for k, argv in ipairs(inputs) do
|
||||||
|
Gate.input(gate, argv)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
sim.inputqueue = nil
|
sim.inputqueue = nil
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user