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 fast arrow and fask masks colliding. #28

Merged
merged 1 commit into from
Feb 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions code/source/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
3 changes: 2 additions & 1 deletion code/source/rnd/link.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
12 changes: 6 additions & 6 deletions code/source/rnd/settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
Loading