Gap-fill warehouse entries in update_warehouses (don't clobber on save)#438
Merged
rp- merged 1 commit intoJun 15, 2026
Merged
Conversation
update_warehouses() runs on every Mission.save(). It unconditionally overwrote the warehouse entry for every ship-with-parking and every FARP with a fresh default, discarding any customized warehouse configuration (coalition, size, inventory, suppliers, operating levels, ...) on every save. Guard each write so existing entries are preserved and only missing ones get a default -- gap-fill, matching the docstring's stated intent. pydcs#436 fixed the symmetric read side (load_dict dropped the serialized "warehouses" sub-dict); this fixes the write side. Closes pydcs#427.
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.
update_warehouses()runs on everyMission.save(). It unconditionally overwrote the warehouse entry for every ship-with-parking and every FARP with a fresh default, discarding any customized warehouse configuration (coalition, size, inventory, suppliers, operating levels, ...) on every save. This guards each write so existing entries are preserved and only missing ones get a default -- gap-fill, matching the docstring's stated intent.#436 fixed the symmetric read side (
load_dictdropped the serializedwarehousessub-dict); this fixes the write side.Tested via a direct
update_warehouses()call rather than save->reload, since the symmetric read-side fix (#436) isn't on this base branch; this isolates the write-side behavior.Closes #427.