Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix fruit positions getting mangled when exploded from the plate #29403

Merged
merged 3 commits into from
Aug 13, 2024

Conversation

smoogipoo
Copy link
Contributor

@smoogipoo smoogipoo commented Aug 13, 2024

Fixes #29319

This is an incorrect use of DrawablePool<>.

We have two caught fruit [ a, b ] and they're released back to the pool. Almost immediately afterwards they're re-retrieved from the pool as now [ b, a ] respectively because DrawablePool internally is a Stack<>. This means the DrawPosition would get mangled by the time the second hitobject is supposed to "copy" its position from the original object.
In-fact, for this particular test, the second object will always have x-position=0 if this occurs, which is why the assertion works.

The effects of this are actually larger than the issue makes it sound, as it affects all objects in the plate. It's why the objects look like they're collapsing towards the centre:

2024-08-13.18-39-03.mp4

Compared to after this fix:

2024-08-13.18-41-34.mp4

I don't see this in my Rider locally. I suppose we can remove it, though
it was intentionally added so that the struct mirrors the interface.
@peppy peppy self-requested a review August 13, 2024 13:52
@peppy peppy merged commit 1b29b9b into ppy:master Aug 13, 2024
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Some fruits on the platter randomly disappear when an explosion happens at the end of a combo
2 participants