summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordjevangelia <263709373+djevangelia@users.noreply.github.com>2026-08-06 21:08:23 +0200
committerGitHub <noreply@github.com>2026-08-06 19:08:23 +0000
commita089fa60bac7c28f1dfcd1d570dea275fdb4bc62 (patch)
tree040676068503c7776cddca5335ecad6bbc78c801
parentf5244973bd46edac7e750ea497cc6221224cfa1d (diff)
Restoration, hover fishing condition + XZ speed (#7031)
-rw-r--r--soh/soh/Enhancements/Fishing.cpp17
-rw-r--r--soh/soh/Enhancements/game-interactor/vanilla-behavior/GIVanillaBehavior.h17
-rw-r--r--soh/src/overlays/actors/ovl_player_actor/z_player.c13
3 files changed, 42 insertions, 5 deletions
diff --git a/soh/soh/Enhancements/Fishing.cpp b/soh/soh/Enhancements/Fishing.cpp
index cddfaa21b..ea29fa882 100644
--- a/soh/soh/Enhancements/Fishing.cpp
+++ b/soh/soh/Enhancements/Fishing.cpp
@@ -3,6 +3,7 @@
extern "C" {
#include <variables.h>
+#include <functions.h>
extern PlayState* gPlayState;
extern SaveContext gSaveContext;
f32 Fishing_GetMinimumRequiredScore();
@@ -19,6 +20,21 @@ void RegisterFishingMessages() {
COND_ID_HOOK(OnOpenText, 0x4080, CVarGetInteger(CVAR_ENHANCEMENT("CustomizeFishing"), 0), BuildFishingMessage);
}
+void RegisterHoverFishing() {
+ COND_VB_SHOULD(VB_NOT_CAST_FISHING, (CVarGetInteger(CVAR_ENHANCEMENT("HoverFishing"), false)), {
+ Vec3f* rodCheckPos = va_arg(args, Vec3f*);
+ *should = false;
+ // Run only original NTSC 1.0 check before cast
+ if (BgCheck_SphVsFirstPoly(&gPlayState->colCtx, rodCheckPos, 20.0f)) {
+ *should = true;
+ }
+ });
+
+ COND_VB_SHOULD(VB_FISHING_ZERO_XZ, (CVarGetInteger(CVAR_ENHANCEMENT("HoverFishing"), false)), {
+ *should = false; // NTSC 1.0
+ });
+}
+
// Vanilla bug: Not possible to fish with blank B because blank B item value 0xFF is saved
// as temp B = disabled B -> fishing pole is unequipped.
// Fix: If fishing, disregard disabled B and on B press set used item to fishing pole.
@@ -43,5 +59,6 @@ void RegisterAllowFishingBlankB() {
}
static RegisterShipInitFunc initFunc(RegisterFishingMessages, { CVAR_ENHANCEMENT("CustomizeFishing") });
+static RegisterShipInitFunc initHoverFishing(RegisterHoverFishing, { CVAR_ENHANCEMENT("HoverFishing") });
static RegisterShipInitFunc initAllowFishingBlankB(RegisterAllowFishingBlankB,
{ CVAR_ENHANCEMENT("FishingBlankB"), "IS_RANDO" });
diff --git a/soh/soh/Enhancements/game-interactor/vanilla-behavior/GIVanillaBehavior.h b/soh/soh/Enhancements/game-interactor/vanilla-behavior/GIVanillaBehavior.h
index abc3b3793..8a7c833d9 100644
--- a/soh/soh/Enhancements/game-interactor/vanilla-behavior/GIVanillaBehavior.h
+++ b/soh/soh/Enhancements/game-interactor/vanilla-behavior/GIVanillaBehavior.h
@@ -2575,6 +2575,23 @@ typedef enum {
// #### `result`
// ```c
+ // !(this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) || (this->actor.world.pos.z > 1300.0f) ||
+ // BgCheck_SphVsFirstPoly(&play->colCtx, &rodCheckPos, 20.0f)
+ // ```
+ // #### `args`
+ // - `*f32`
+ VB_NOT_CAST_FISHING,
+
+ // #### `result`
+ // ```c
+ // true
+ // ```
+ // #### `args`
+ // - None
+ VB_FISHING_ZERO_XZ,
+
+ // #### `result`
+ // ```c
// false
// ```
// #### `args`
diff --git a/soh/src/overlays/actors/ovl_player_actor/z_player.c b/soh/src/overlays/actors/ovl_player_actor/z_player.c
index 521dc3249..933e74203 100644
--- a/soh/src/overlays/actors/ovl_player_actor/z_player.c
+++ b/soh/src/overlays/actors/ovl_player_actor/z_player.c
@@ -6598,17 +6598,20 @@ s32 func_8083C6B8(PlayState* play, Player* this) {
rodCheckPos.y += 50.0f;
- if (CVarGetInteger(CVAR_ENHANCEMENT("HoverFishing"), 0)
- ? 0
- : !(this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) || (this->actor.world.pos.z > 1300.0f) ||
- BgCheck_SphVsFirstPoly(&play->colCtx, &rodCheckPos, 20.0f)) {
+ if (GameInteractor_Should(VB_NOT_CAST_FISHING,
+ (!(this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) ||
+ (this->actor.world.pos.z > 1300.0f) ||
+ BgCheck_SphVsFirstPoly(&play->colCtx, &rodCheckPos, 20.0f)),
+ &rodCheckPos)) {
Sfx_PlaySfxCentered(NA_SE_SY_ERROR);
return 0;
}
Player_SetupAction(play, this, Player_Action_80850C68, 0);
this->unk_860 = 1;
- Player_ZeroSpeedXZ(this);
+ if (GameInteractor_Should(VB_FISHING_ZERO_XZ, true)) {
+ Player_ZeroSpeedXZ(this);
+ }
Player_AnimPlayOnce(play, this, &gPlayerAnim_link_fishing_throw);
return 1;
} else {