Remove duplicated callings set()
from SceneTreeDock
#87834
Merged
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.
Fixes #77866
SceneTreeDock modifies the value of NodePath when there is a change in the tree, but it duplicates a direct
set()
call, even though the modification is executed in theUndoRedo::add_do_property()
method.This duplicated calling is problematic because it indicates an invalid NodePath, since it is actually called before the Node path change is complete. This is also problematic because unlike applying internal properties it calls the actual setter. Basically, setters should not be called if NodePath points to the same thing.
For example, when setting the ExternalSkeleton in BoneAttachment, the ObjectID of the Node is cached, but it does not indicate the correct Node at the time of the first call when the BoneAttachment change the nest in the SceneTree, then the error is caused. (But the
UndoRedo::add_do_property()
is fired immediately after the first call, so the error is resolved immediately afterwards).This PR remove these unneeded callings
set()
.