Skip to content

Normalize null ConstructionStockpile.Items before raising a paste - #36

Open
viktor-ferenczi wants to merge 1 commit into
mainfrom
stockpile-paste-null-items
Open

Normalize null ConstructionStockpile.Items before raising a paste#36
viktor-ferenczi wants to merge 1 commit into
mainfrom
stockpile-paste-null-items

Conversation

@viktor-ferenczi

Copy link
Copy Markdown
Contributor

A blueprint saved with a partially built block carries a <ConstructionStockpile> with no Items children; the game's XML reader deserializes it to Items == null, and VRage's event serializer then refuses the null when TryPasteGrid_Implementation is raised in a hosted session. Vanilla game bug: reproduced on the Windows binaries under Proton with this plugin absent (pulsar-tests se1/reports/evidence/proton-attribution).

Every paste route constructs MyPasteGridParameters through its single constructor, so a prefix there catches the UI clipboard, the grid storage helper, visual scripting and plugin-raised pastes without touching the reader or the wire format. Recurses into projected grids, which carry the same object builders.

A blueprint saved with a partially built block carries a
<ConstructionStockpile> with no Items children; the game's XML reader
deserializes it to Items == null, and VRage's event serializer then
refuses the null when TryPasteGrid_Implementation is raised in a hosted
session. Vanilla game bug: reproduced on the Windows binaries under
Proton with this plugin absent (pulsar-tests
se1/reports/evidence/proton-attribution).

Every paste route constructs MyPasteGridParameters through its single
constructor, so a prefix there catches the UI clipboard, the grid
storage helper, visual scripting and plugin-raised pastes without
touching the reader or the wire format. Recurses into projected grids,
which carry the same object builders.
@viktor-ferenczi

Copy link
Copy Markdown
Contributor Author

Test on Windows. If the issue happens there, then it is a game bug and the fix does not belong here. If it works on Windows, then it may belong to dotnet-compat instead.

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