1
0
mirror of https://github.com/ComfyFactory/ComfyFactorio.git synced 2025-01-22 03:38:48 +02:00

Bugfix: Biter Battles: Mirroring issue on important number of entities/tiles to process

This commit is contained in:
MaemiKozue 2019-10-12 19:55:16 +02:00
parent ebd11a96f2
commit 45527670c8

View File

@ -246,13 +246,17 @@ local function ticking_work()
local task = tasks[c.state] local task = tasks[c.state]
-- game.print(task.name) -- game.print(task.name)
d = d or task.list() d = d or task.list()
local last_idx = nil
for k, v in pairs(d) do for k, v in pairs(d) do
task.action(v) task.action(v)
d[k] = nil d[k] = nil
last_idx = k
w = w + 1 w = w + 1
if w > work then break end if w > work then break end
end end
if #d == 0 then
local next_idx, _ = next(d, last_idx)
if next_idx == nil then
c.state = c.state + 1 c.state = c.state + 1
c.data = nil c.data = nil
else else