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: Reset waterbox collisions in Lake Hylia and Morphas room #2346

Merged
merged 2 commits into from
Jan 17, 2023

Conversation

Archez
Copy link
Contributor

@Archez Archez commented Jan 10, 2023

Due to Ships resource caching and the game code modifying waterbox collisions, modifications are permanently made to the cached data, meaning that subsequent loads of scenes already have modified waterboxes and behave incorrectly.

In lieu of a cache invalidation mechanism for scenes, this PR resets the modified waterboxes to their original load value when ever the scene loads/unloads.

Both Lake Hylia and Morphas room have fixes added to fix the waterbox as reported from the issue bellow.

Fixes #2331

Build Artifacts

this->dyna.actor.world.pos.y = WATER_LEVEL_RAISED;
this->actionFunc = BgSpot06Objects_DoNothing;
} else {
// Go slightly beyond -681 so the smoothing doesn't slow down too much (matches the reverse of water rise func)
Math_SmoothStepToF(&this->lakeHyliaWaterLevel, -682.0f, 0.1f, 1.0f, 0.001f);
play->colCtx.colHeader->waterBoxes[LHWB_GERUDO_VALLEY_RIVER_LOWER].ySurface = WATER_LEVEL_RIVER_LOWERED;
play->colCtx.colHeader->waterBoxes[LHWB_GERUDO_VALLEY_RIVER_LOWER].zMin = WATER_LEVEL_RIVER_LOWER_Z - 50;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Archez this 50 feels like a magic number, could you explain where it's coming from?

Copy link
Contributor Author

@Archez Archez Jan 17, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Its to mimic what happens from the Init func

play->colCtx.colHeader->waterBoxes[LHWB_GERUDO_VALLEY_RIVER_LOWER].zMin -= 50;

I can instead create a separate #define that contains the subtraction

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can instead create a separate #define that contains the subtraction

no need, thanks for explaining!

@dcvz dcvz merged commit fda198d into HarbourMasters:develop-bradley Jan 17, 2023
@Archez Archez deleted the fix-waterbox-collisions branch January 17, 2023 20:03
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.

None yet

3 participants