Fix lab assignment on transfer#1565
Merged
JonnyH merged 4 commits intoOpenApoc:masterfrom Jan 8, 2026
Merged
Conversation
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
97c118d to
c8665b6
Compare
An agent being added/removed to a lab, or a lab being full, are not a problem so shouldn't be a warning
Collaborator
Author
|
Fixes #1559 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.