Skip to content

Gap-fill warehouse entries in update_warehouses (don't clobber on save)#438

Merged
rp- merged 1 commit into
pydcs:masterfrom
MacrayBlackhand:fix-update-warehouses-clobbers-entries
Jun 15, 2026
Merged

Gap-fill warehouse entries in update_warehouses (don't clobber on save)#438
rp- merged 1 commit into
pydcs:masterfrom
MacrayBlackhand:fix-update-warehouses-clobbers-entries

Conversation

@MacrayBlackhand

Copy link
Copy Markdown
Contributor

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. 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_dict dropped the serialized warehouses sub-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.

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.
@rp- rp- merged commit adea367 into pydcs:master Jun 15, 2026
2 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.

Mission.update_warehouses() overwrites existing ship/FARP warehouse entries on every save

2 participants