Skip to content

Fix stale Leech Seed visual after Shed Tail switch#2611

Closed
frxyoz wants to merge 1 commit intosmogon:masterfrom
frxyoz:fix-shedtail-leechseed-visual
Closed

Fix stale Leech Seed visual after Shed Tail switch#2611
frxyoz wants to merge 1 commit intosmogon:masterfrom
frxyoz:fix-shedtail-leechseed-visual

Conversation

@frxyoz
Copy link
Copy Markdown

@frxyoz frxyoz commented Mar 2, 2026

Fixes a client-side visual desync where Leech Seed particles could remain on the incoming Pokémon after a seeded user switched out with Shed Tail.
Root cause: volatile state in copyVolatileForm reused shared object references, then removed entries without fully clearing source-side sprite effects.
Fix: clone boosts/volatiles instead of aliasing, and clear source volatile visuals after transfer so old effects (including Leech Seed) are removed reliably.
Changed file: play.pokemonshowdown.com/src/battle.ts
Validation: local build succeeds (npm run build), TS compile passes.

Closes https://github.com//issues/2447

@Zarel
Copy link
Copy Markdown
Member

Zarel commented Mar 15, 2026

Wait, why are we copying volatiles with Shed Tail in the first place?

@frxyoz
Copy link
Copy Markdown
Author

frxyoz commented Mar 15, 2026

Could it be that the code might've been forked from the baton pass code?

@Zarel
Copy link
Copy Markdown
Member

Zarel commented Mar 16, 2026

I'd probably suggest fixing that part, then. If you can link to a Shed Tail replay, I can look into that.

@frxyoz
Copy link
Copy Markdown
Author

frxyoz commented Mar 16, 2026

Here's a replay I grabbed from the original issue

https://replay.pokemonshowdown.com/gen9randombattle-2311255360

Luxray has the leech seed overlay, but it can be cleared with skipping forward.

Zarel added a commit that referenced this pull request Mar 19, 2026
@Zarel Zarel closed this Mar 19, 2026
@Zarel
Copy link
Copy Markdown
Member

Zarel commented Mar 19, 2026

Though I didn't end up using your code, do note that I still appreciate your contribution, and it helped me figure out what was wrong!

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.

2 participants