ILLISIS / Constructron-Continued

Other
13 stars 21 forks source link

Non-recoverable error with 1.0.50 #104

Closed gabfv closed 1 year ago

gabfv commented 1 year ago

Hi, I've installed the 1.0.50 update this morning but it causes a non-recoverable error when loading my save: image I've looked at the code where it was specified and it looks like because the job object doesn't have an attempt property? I'm not super familiar with making Factorio mods but I think it needed a migration to apply this property to all currently running jobs?

gabfv commented 1 year ago

Oh, is the fix similar to what is being done for this? https://github.com/ILLISIS/Constructron-Continued/blob/main/migrations/Constructron-Continued_1.0.27.lua#L1

gabfv commented 1 year ago

Oh I was able to fix it with a new migration:

-- Fixes for job.attempt nil crash
for job_bundle_index, job_bundle in pairs(global.job_bundles) do
    for index, job in pairs(global.job_bundles[job_bundle_index]) do
        if job.attempt == nil then
            global.job_bundles[job_bundle_index][index].attempt = 1
        end
    end
end
game.print('Constructron-Continued: v1.0.50 migration complete!')
ILLISIS commented 1 year ago

Thanks! It is fixed in v1.0.51 I almost used this but opted for a smaller change as I was on the fence and in a rush.

gabfv commented 1 year ago

Neat, I confirm this is working for 1.0.51!