diff --git a/code/source/main.cpp b/code/source/main.cpp index 1e8a3677..54d248fc 100644 --- a/code/source/main.cpp +++ b/code/source/main.cpp @@ -100,9 +100,9 @@ namespace rnd { const u32 pressedButtons = gctx->pad_state.input.buttons.flags; const u32 newButtons = gctx->pad_state.input.new_buttons.flags; #if defined ENABLE_DEBUG || defined DEBUG_PRINT - auto& saveData = game::GetCommonData().save; + auto* saveData = GetContext().gctx->GetPlayerActor(); if (newButtons == (u32)game::pad::Button::ZR) - rnd::util::Print("%s: Sword flag is %u\n", __func__, saveData.player.magic); + rnd::util::Print("%s: Player held item is %#04x\n", __func__, saveData->held_item); #endif if (gSettingsContext.customMaskButton != 0 && pressedButtons == gSettingsContext.customMaskButton) { game::ui::OpenScreen(game::ui::ScreenType::Masks); diff --git a/code/source/rnd/link.cpp b/code/source/rnd/link.cpp index 699a2828..2a104fcf 100644 --- a/code/source/rnd/link.cpp +++ b/code/source/rnd/link.cpp @@ -131,7 +131,8 @@ namespace rnd::link { // Reset the override action if the player is not using a bow. constexpr u8 first = u8(game::Action::Arrow); constexpr u8 last = u8(game::Action::LightArrow); - const bool is_using = player->action_type == game::act::Player::ActionType::Type3 || player->projectile_actor; + const bool is_using = player->action_type == game::act::Player::ActionType::Type3 || player->projectile_actor || + (player->held_item > game::ItemId::Ocarina && player->held_item < game::ItemId::FairyOcarina); if (first > u8(player->current_action) || u8(player->current_action) > last || !is_using) { s_fast_arrow_state = {}; return; diff --git a/code/source/rnd/settings.cpp b/code/source/rnd/settings.cpp index 2f8c2030..da760eea 100644 --- a/code/source/rnd/settings.cpp +++ b/code/source/rnd/settings.cpp @@ -111,19 +111,19 @@ namespace rnd { // If we're disabled then just run the default return. if (gSettingsContext.enableFastArrowSwap == 0) { return gSettingsContext.enableFastMaskTransform; - } else if (gSettingsContext.enableFastMaskTransform && - player->flags1.IsSet(game::act::Player::Flag1::FirstPersonMode) && - (player->held_item >= game::ItemId::Arrow && player->held_item <= game::ItemId::LightArrow)) { + } else if ((gSettingsContext.enableFastMaskTransform && + player->flags1.IsSet(game::act::Player::Flag1::FirstPersonMode)) || + (player->held_item >= game::ItemId::Arrow && player->held_item <= game::ItemId::LightArrow)) return 0x00; - } else { + else { return gSettingsContext.enableFastMaskTransform; } } } // TODO: Change the addr /* typedef void (*Health_ChangeBy_proc)(GlobalContext *arg1, u32 arg2); - #define Health_ChangeBy_addr 0x352dbc - #define Health_ChangeBy ((Health_ChangeBy_proc)Health_ChangeBy_addr) + #define Health_ChangeBy_addr 0x352dbc + #define Health_ChangeBy ((Health_ChangeBy_proc)Health_ChangeBy_addr) void FairyPickupHealAmount(void) { if (gSettingsContext.heartDropRefill == HeartDropRefillSetting::HEARTDROPREFILL_NOREFILL \ || gSettingsContext.heartDropRefill == HeartDropRefillSetting::HEARTDROPREFILL_NODROPREFILL) {