1
0
mirror of https://github.com/LDDestroier/CC/ synced 2024-06-25 22:53:18 +00:00

Doesn't resume off-screen inactive coroutines

This commit is contained in:
LDDestroier 2019-04-26 01:35:46 -04:00 committed by GitHub
parent a9cc18ca5a
commit 904449d831
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -821,6 +821,8 @@ local main = function()
config.timesRan = config.timesRan + 1
saveConfig()
local previousTerm
while isRunning do
gridWidth, gridHeight, gridMinX, gridMinY = getMapSize()
@ -967,8 +969,8 @@ local main = function()
for x = gridMinX, gridWidth do
if instances[y][x] then
if justStarted or (not inputEvt[evt[1]]) or (x == focus[1] and y == focus[2]) then
local previousTerm = term.redirect(instances[y][x].window.handle)
if justStarted or ((not inputEvt[evt[1]]) and instances[y][x].active or (x == focus[1] and y == focus[2])) then
previousTerm = term.redirect(instances[y][x].window.handle)
coroutine.resume(instances[y][x].co, table.unpack(evt))
term.redirect(previousTerm)
end