1
0
mirror of https://github.com/ComfyFactory/ComfyFactorio.git synced 2025-02-09 13:37:02 +02:00

Merge pull request #67 from MaemiKozue/master

Bugfix: Biter Battles: Mirroring issue on important number of entities/tiles to process
This commit is contained in:
MewMew 2019-10-12 20:04:56 +02:00 committed by GitHub
commit 94b70ceb14
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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