Repository navigation
Keep a structure's pieces when Update changes nothing - #1379
Merged
Merged
Conversation
saworbit
enabled auto-merge (squash)
October 21, 2026 00:18
3 tasks
1 task
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 on a structure nobody changed rebuilt every piece under a new id and recorded a step. That broke anything that named the old ids (a wire, a cordon round them, a prefab record) and left an undo step that undid nothing.
HFGeneratorSystem.update_changes_nothing(generator_id, settings)is the one check. It is true when the settings build the same structure as the record's and every piece the record names is still there, still this structure's, and still the shape and place it was built in (edited_brush_ids()empty). A piece with no signature, or whose id now names a brush that is not ours ([Review] Rebuilds: prefab and generator rebuilds each re-carry per-copy state field by field, so every new property is lost until reported #1221), counts as a change, so the rebuild goes ahead as before.same_settings()reads both sides through the schema's merge and compares floats withis_equal_approx. A plain==fails on 4 against 4.0, and a SpinBox hands back some on-step values a rounding away (0.4, 1.2, 1.7 on a 0.05 step).update_structurekeeps every id and answersno_change: true. With Record no bridge step for a call that changed nothing, and replace the default cordon #1378 the dispatcher then records no step either; tested together locally.regenerate()itself still always rebuilds.Tests: seven in
test_structure_dock_commands.gd(unchanged Update from the toolbar and the section keeps ids and records no step; every type at its defaults; settings from outside the dock with 1.7/0.4/1.2; a setting change, an edited piece, a piece moved on its own and a deleted piece still rebuild with one step). Two intest_mcp_dispatcher_structures.gd, fifteen predicate tests intest_generator_system.gd, one line in the MCPstructuresvibe scenario. Mutation checked on each guard. Local: test_generator_system 104, test_structure_dock_commands 29, test_mcp_dispatcher_structures 16, test_live_generator 45, test_mcp_command_sweep, and more, all green. With #1378 merged in on a scratch branch: the sweep, the structure and command dispatcher tests and thestructuresscenario pass.Also folded in: the dock committed Update without the absolute redo Create got in #1275, so a redo of an Update minted new piece ids and a later step that named one found nothing. One argument in
dock_brush_handler.gd, pinned bytest_redo_of_an_update_gives_back_the_pieces_it_made(failed on the old call).Fixes #1368