cleanup lake hylia swim spawn hook (#6887)

This commit is contained in:
Philip Dubé
2026-07-08 13:58:23 +00:00
committed by GitHub
parent 10cde0b8ad
commit 3a12eeaa71
3 changed files with 11 additions and 12 deletions
@@ -2124,6 +2124,14 @@ typedef enum {
// - `s16 yawTarget` (stick world-space yaw, promoted to int in va_list)
VB_PLAYER_ROLL_STEER,
// #### `result`
// ```c
// this->ageProperties->unk_24 <= ySurface
// ```
// #### `args`
// - `Player*`
VB_PLAYER_SPAWN_SWIMMING,
// #### `result`
// ```c
// item == ITEM_SAW
@@ -3237,14 +3245,6 @@ typedef enum {
// - `s16* (&this->actor.parent->id)`
VB_PREVENT_HOOKSHOT_PARENT_SOFTLOCK,
// #### `result`
// ```c
// false if Link is adult, water level is lowered, and entering Lake from Domain
// ```
// #### `args`
// - `Player*`
VB_LAKE_HYLIA_PREVENT_DOMAIN_SWIM,
// #### `result`
// true if Goron Link is talking
// ```
@@ -1851,7 +1851,7 @@ void RandomizerOnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, va_l
*should = false;
break;
}
case VB_LAKE_HYLIA_PREVENT_DOMAIN_SWIM: {
case VB_PLAYER_SPAWN_SWIMMING: {
// Don't swim as adult coming from Domain to Lake with low water.
// Caused by waterbox first frame y surface always being -1313.0f
Player* player = va_arg(args, Player*);
@@ -6638,10 +6638,9 @@ s32 Player_SetStartingMovement(PlayState* play, Player* this, f32 arg2) {
ySurface = this->actor.world.pos.y;
if (WaterBox_GetSurface1(play, &play->colCtx, this->actor.world.pos.x, this->actor.world.pos.z, &ySurface,
&waterbox) &&
GameInteractor_Should(VB_LAKE_HYLIA_PREVENT_DOMAIN_SWIM, true, this)) {
&waterbox)) {
ySurface -= this->actor.world.pos.y;
if (this->ageProperties->unk_24 <= ySurface) {
if (GameInteractor_Should(VB_PLAYER_SPAWN_SWIMMING, this->ageProperties->unk_24 <= ySurface, this)) {
Player_SetupAction(play, this, Player_Action_8084D7C4, 0);
Player_AnimChangeLoopSlowMorph(play, this, &gPlayerAnim_link_swimer_swim);
this->stateFlags1 |= PLAYER_STATE1_IN_WATER | PLAYER_STATE1_IN_CUTSCENE;