diff --git a/sim/main.lua b/sim/main.lua index 16f6c0a..66d36d4 100644 --- a/sim/main.lua +++ b/sim/main.lua @@ -314,7 +314,9 @@ while 1 do end if time-lastfxtime >= OPT_FX_TIME then - sim:sendfxupdate() + if OPT_FX_UPDATES then + sim:sendfxupdate() + end sim:sendcallbacks() lastfxtime = time end diff --git a/sim/simulation.lua b/sim/simulation.lua index 9b1593a..7dabfa3 100644 --- a/sim/simulation.lua +++ b/sim/simulation.lua @@ -301,25 +301,17 @@ function Simulation:sendfxupdate() for k, group in pairs(self.groupfxqueue) do if group.state ~= group.fxstate then group.fxstate = group.state - + local data = bool_to_int[group.state] - - if OPT_FX_UPDATES then - for i, wire in pairs(group.wires) do - data = data .. "\t" .. wire.objref - end - else - for i, wire in pairs(group.wires) do - if wire.isvisual then - data = data .. "\t" .. wire.objref - end - end + + for i, wire in pairs(group.wires) do + data = data .. "\t" .. wire.objref end - + client:send("WU\t" .. data .. "\n") end end - + self.groupfxqueue = {} end