Skip to content

fix: use normal water reflection when surfing under bridge#147

Open
aloven wants to merge 1 commit into
resetes12:masterfrom
aloven:fix/surf-shadow-reflection
Open

fix: use normal water reflection when surfing under bridge#147
aloven wants to merge 1 commit into
resetes12:masterfrom
aloven:fix/surf-shadow-reflection

Conversation

@aloven

@aloven aloven commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Description:

Fixes a visual bug where the player's reflection sprite would appear as a dark blob (bridge shadow palette) instead of a normal water reflection after returning from a battle while surfing under a bridge (e.g., Route 119/120).

Root cause: LoadObjectReflectionPalette checks currentMetatileBehavior for bridge type. Since the map grid returns the upper layer's metatile at that X/Y (the bridge), the function incorrectly selected the high-bridge dark blue palette. The PLAYER_AVATAR_FLAG_SURFING flag isn't restored yet during the ground effects initialization after battle return.

Fix: Check the object event's graphicsId for surfing sprite IDs (which persist through battle return). If the player has a surfing graphic, use the normal water reflection palette regardless of bridge metatile behavior.

Resolves #146

After returning from battle while surfing under a bridge, the reflection
sprite was incorrectly using the high-bridge dark blue palette (because
the player's currentMetatileBehavior reads the bridge tile at that X/Y
coordinate from the upper map layer).

Fix: in LoadObjectReflectionPalette, check if the object event has a
surfing graphics ID (which persists through battle return, unlike the
PLAYER_AVATAR_FLAG_SURFING flag which is restored later). If surfing,
use the normal water reflection palette instead of the bridge palette.
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.

Shadow instead of reflection triggered due to bridges

1 participant