Skip to content

Fix lab assignment on transfer#1565

Merged
JonnyH merged 4 commits intoOpenApoc:masterfrom
JonnyH:WIP/lab-assignment-rework
Jan 8, 2026
Merged

Fix lab assignment on transfer#1565
JonnyH merged 4 commits intoOpenApoc:masterfrom
JonnyH:WIP/lab-assignment-rework

Conversation

@JonnyH
Copy link
Collaborator

@JonnyH JonnyH commented Jan 8, 2026

Cleans up agent lab assignment, rather than keeping a separate boolean and StateRef just use that ref being null to imply no lab assigned.

Though it changes the serialized format - removing that assigned_to_lab flag, it should actually affect backward compatibility with older saves - as that should already be implied by the non-null lab_assigned, and them being out of sync is a failure anyway. At next load, that unused flag should be ignored and future saves will not write it.

Compatibility of new saves with old game versions, however, will break.

JonnyH added 3 commits January 7, 2026 19:55
Cleans up agent lab assignment, rather than keeping a separate boolean and StateRef<Lab> just use that ref being null to imply no lab assigned.
Tests some cases with agents assigned to labs and serialized in/out,
transferred or killed
Not sure why this can't just use the assigned reference list size, leave the counting in and an assert for now to ensure I haven't missed a reason
@JonnyH JonnyH force-pushed the WIP/lab-assignment-rework branch from 97c118d to c8665b6 Compare January 8, 2026 03:55
An agent being added/removed to a lab, or a lab being full, are not a problem so shouldn't be a warning
@JonnyH
Copy link
Collaborator Author

JonnyH commented Jan 8, 2026

Fixes #1559

@JonnyH JonnyH merged commit 453c597 into OpenApoc:master Jan 8, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant