script.on_event(defines.events.on_chunk_generated, function(event)
if event.surface.name == "nauvis" then
Process(event.surface, event.area)
end
end)
function Process(s, a)
game.players[1].print("Process")
Operate()
end
function Operate()
function Process(s, a)
for i = 1, 10, 1 do
game.players[1].print("Operate " .. i)
if surface.is_chunk_generated(current_position) then
...
end
end
end
end
Logically I'm expecting to see:
expectation
Process
Operate 1
...
Operate 10
Process
Operate 1
...
Operate 10
...
...one cycle for each chunk. BUT I'm getting:
irl
Process
Operate 1
Operate 2
Process
Process
Process
Operate 3
Operate 4
Process
Operate 5
...
script.on_event(defines.events.on_chunk_generated, function(event)
if event.surface.name == "nauvis" then
--ProcessOilPatches(event.surface, event.area)
local res = "false"
if event.surface.is_chunk_generated({event.area.left_top.x + 10, event.area.left_top.y + 10}) then
res = "true"
end
game.players[1].print("Is generated chunk generated: " .. res)
end
end)
And can see only repeating "falses" as the result... What's wrong?
Any code or mods posted by me are WTFPL, unless otherwise copyrights are specified.