Fix crash when clicking on another object mid-placement of spinner - #38513
Merged
Conversation
You might be thinking: "@bdach is dumb and/or incompetent for not just directly reverting ppy#38464 and instead just reverting half of it in ppy#38506". That is certainly what *I* was thinking until I tried reverting and found that it actually doesn't help. This is actually a silent regression from ppy#37485! The chain of failure goes something like this: 1. Start with editor seeked to a start time of one of the existing objects. 2. Begin placing a spinner. 3. Click the object that starts at the current time. 4. On master, `SpinnerPlacementBlueprint` does not consume the left click input when spinner placement has already started. This means that the left click input is allowed to fall through to the blueprint container. 5. When the left click input falls through to the blueprint container, it triggers selection logic to fire and the existing object to become selected. 6. Object selection changing also changes the currently used tool to the "select" tool: https://github.com/ppy/osu/blob/cd27c935d6c15c3c6f2f5b561cc3340130f27407/osu.Game/Rulesets/Edit/HitObjectComposer.cs#L504-L511 7. Changing the currently used tool causes any pending placement to be committed if valid: https://github.com/ppy/osu/blob/abbf6e23492c471d722827c5b8baa935fad19419/osu.Game/Screens/Edit/Compose/Components/ComposeBlueprintContainer.cs#L437-L438 8. Committing the placement causes *the object whose attempt at selection triggered this entire chain of events to begin with* to be removed: https://github.com/ppy/osu/blob/cd27c935d6c15c3c6f2f5b561cc3340130f27407/osu.Game/Rulesets/Edit/HitObjectComposer.cs#L545-L550 And therefore the failure is understandable, because at that point the placement blueprint of the now-removed object *really* does not reside in the container. Prior to ppy#37485 this would not cause an issue because the objects would both exist here. To fix, prevent the issue at point (4) by making the placement blueprint consume left clicks and not allow fall-through to existing objects.
peppy
self-requested a review
August 4, 2026 09:22
peppy
approved these changes
Aug 4, 2026
peppy
left a comment
Member
There was a problem hiding this comment.
Confirm crash and confirm fix. Editor interactions are... complex.
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.
Closes #38509.
You might be thinking: "@bdach is dumb and/or incompetent for not just directly reverting #38464 and instead just reverting half of it in #38506". That is certainly what I was thinking until I tried reverting and found that it actually doesn't help. This is actually a silent regression from #37485!
The chain of failure goes something like this:
Start with editor seeked to a start time of one of the existing objects.
Begin placing a spinner.
Click the object that starts at the current time.
On master,
SpinnerPlacementBlueprintdoes not consume the left click input when spinner placement has already started. This means that the left click input is allowed to fall through to the blueprint container.When the left click input falls through to the blueprint container, it triggers selection logic to fire and the existing object to become selected.
Object selection changing also changes the currently used tool to the "select" tool:
osu/osu.Game/Rulesets/Edit/HitObjectComposer.cs
Lines 504 to 511 in cd27c93
Changing the currently used tool causes any pending placement to be committed if valid:
osu/osu.Game/Screens/Edit/Compose/Components/ComposeBlueprintContainer.cs
Lines 437 to 438 in abbf6e2
Committing the placement causes the object whose attempt at selection triggered this entire chain of events to begin with to be removed:
osu/osu.Game/Rulesets/Edit/HitObjectComposer.cs
Lines 545 to 550 in cd27c93
And therefore the failure is understandable, because at that point the placement blueprint of the now-removed object really does not reside in the container.
Prior to Replace hit objects when placing at same time in editor #37485 this would not cause an issue because the objects would both exist here.
To fix, prevent the issue at point (4) by making the placement blueprint consume left clicks and not allow fall-through to existing objects.