mirror of
https://github.com/LDDestroier/CC/
synced 2024-11-13 05:20:00 +00:00
Doesn't resume off-screen inactive coroutines
This commit is contained in:
parent
a9cc18ca5a
commit
904449d831
@ -822,6 +822,8 @@ local main = function()
|
|||||||
config.timesRan = config.timesRan + 1
|
config.timesRan = config.timesRan + 1
|
||||||
saveConfig()
|
saveConfig()
|
||||||
|
|
||||||
|
local previousTerm
|
||||||
|
|
||||||
while isRunning do
|
while isRunning do
|
||||||
gridWidth, gridHeight, gridMinX, gridMinY = getMapSize()
|
gridWidth, gridHeight, gridMinX, gridMinY = getMapSize()
|
||||||
local evt = {os.pullEventRaw()}
|
local evt = {os.pullEventRaw()}
|
||||||
@ -967,8 +969,8 @@ local main = function()
|
|||||||
for x = gridMinX, gridWidth do
|
for x = gridMinX, gridWidth do
|
||||||
if instances[y][x] then
|
if instances[y][x] then
|
||||||
|
|
||||||
if justStarted or (not inputEvt[evt[1]]) or (x == focus[1] and y == focus[2]) then
|
if justStarted or ((not inputEvt[evt[1]]) and instances[y][x].active or (x == focus[1] and y == focus[2])) then
|
||||||
local previousTerm = term.redirect(instances[y][x].window.handle)
|
previousTerm = term.redirect(instances[y][x].window.handle)
|
||||||
coroutine.resume(instances[y][x].co, table.unpack(evt))
|
coroutine.resume(instances[y][x].co, table.unpack(evt))
|
||||||
term.redirect(previousTerm)
|
term.redirect(previousTerm)
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user