From 6d1a6527d4e205f66b510d6959e5fb9237796284 Mon Sep 17 00:00:00 2001 From: HighTierHumann <159646146+HighTierHumann@users.noreply.github.com> Date: Thu, 27 Aug 2026 15:35:25 -0400 Subject: [PATCH] Bugfix for AlwaysOnFixes.cpp as well as a fallback to prevent crashes when attempting to display an textId 0 (#7123) Add guard to check if camera mode is CAMERA_MODE_FIRST_PERSON before applying fixes Also adds missing PLAYER_IA modes for magic arrows, as well as applying camera fix for Hookshot outside of just lakeside lab. Move gameinteractor for change aiming camera inside bow/sling/hook aiming block --- soh/soh/Enhancements/AlwaysOnFixes.cpp | 7 +++++-- soh/src/overlays/actors/ovl_player_actor/z_player.c | 5 ++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/soh/soh/Enhancements/AlwaysOnFixes.cpp b/soh/soh/Enhancements/AlwaysOnFixes.cpp index 66c270c224..6b33acdb5c 100644 --- a/soh/soh/Enhancements/AlwaysOnFixes.cpp +++ b/soh/soh/Enhancements/AlwaysOnFixes.cpp @@ -130,7 +130,8 @@ void RegisterAlwaysOnFixes() { s8* heldItemAction = va_arg(args, s8*); s32* camMode = va_arg(args, s32*); - if (*heldItemAction == PLAYER_IA_BOW) { + if (*heldItemAction == PLAYER_IA_BOW || *heldItemAction == PLAYER_IA_BOW_FIRE || + *heldItemAction == PLAYER_IA_BOW_ICE || *heldItemAction == PLAYER_IA_BOW_LIGHT) { if (CVarGetInteger(CVAR_ENHANCEMENT("BowSlingshotAmmoFix"), false) || CVarGetInteger(CVAR_ENHANCEMENT("EquipmentAlwaysVisible"), false)) { *camMode = CAM_MODE_AIM_ADULT; @@ -141,7 +142,9 @@ void RegisterAlwaysOnFixes() { *camMode = CAM_MODE_AIM_CHILD; } } else if (*heldItemAction == PLAYER_IA_HOOKSHOT || *heldItemAction == PLAYER_IA_LONGSHOT) { - if (gPlayState->sceneNum == SCENE_LAKESIDE_LABORATORY) { + if (CVarGetInteger(CVAR_ENHANCEMENT("EquipmentAlwaysVisible"), false)) { + *camMode = CAM_MODE_AIM_ADULT; + } else if (gPlayState->sceneNum == SCENE_LAKESIDE_LABORATORY) { *camMode = CAM_MODE_AIM_ADULT; // Fix child Hookshot aiming in lab (CAM_MODE_AIM_CHILD is invalid there) } } else if (*heldItemAction == PLAYER_IA_BOOMERANG) { 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 fe36b2f4b8..0786319c47 100644 --- a/soh/src/overlays/actors/ovl_player_actor/z_player.c +++ b/soh/src/overlays/actors/ovl_player_actor/z_player.c @@ -5858,13 +5858,12 @@ s32 func_8083AD4C(PlayState* play, Player* this) { } else { camMode = CAM_MODE_AIM_BOOMERANG; } + // Check if aiming camera mode should be overridden due to player settings + GameInteractor_Should(VB_CHANGE_AIMING_CAMERA, true, &this->heldItemAction, &camMode); } else { camMode = CAM_MODE_FIRST_PERSON; } - // Check if aiming camera mode should be overridden due to player settings - GameInteractor_Should(VB_CHANGE_AIMING_CAMERA, true, &this->heldItemAction, &camMode); - return Camera_RequestMode(Play_GetCamera(play, CAM_ID_MAIN), camMode); }