Skip to content

Commit

Permalink
Fix Link being given magic on save creation. This should fix all magi…
Browse files Browse the repository at this point in the history
…c check bugs until magic is retrieved.
  • Loading branch information
PhlexPlexico committed Feb 5, 2024
1 parent 576608c commit ac7805c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
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.equipment;
auto& saveData = game::GetCommonData().save;
if (newButtons == (u32)game::pad::Button::ZR)
rnd::util::Print("%s: Sword flag is %u\n", __func__, saveData.sword_shield.sword);
rnd::util::Print("%s: Sword flag is %u\n", __func__, saveData.player.magic);
#endif
if (gSettingsContext.customMaskButton != 0 && pressedButtons == gSettingsContext.customMaskButton) {
game::ui::OpenScreen(game::ui::ScreenType::Masks);
Expand Down
4 changes: 2 additions & 2 deletions code/source/rnd/item_override.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ namespace rnd {
rItemOverrides[0].value.looksLikeItemId = 0x26;
rItemOverrides[1].key.scene = 0x6F;
rItemOverrides[1].key.type = ItemOverride_Type::OVR_COLLECTABLE;
rItemOverrides[1].value.getItemId = 0x48;
rItemOverrides[1].value.looksLikeItemId = 0x48;
rItemOverrides[1].value.getItemId = 0x49;
rItemOverrides[1].value.looksLikeItemId = 0x49;
rItemOverrides[2].key.scene = 0x12;
rItemOverrides[2].key.type = ItemOverride_Type::OVR_COLLECTABLE;
rItemOverrides[2].value.getItemId = 0x37;
Expand Down
3 changes: 3 additions & 0 deletions code/source/rnd/savefile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -700,6 +700,9 @@ namespace rnd {
playerData.magic_acquired = 1;
playerData.magic = 0x60;
equipmentData.data[3].item_btns[0] = game::ItemId::DekuNuts;
} else {
// Player initially is given magic 0x30 on save creation. This prevents that.
playerData.magic = 0x0;
}

if (gSettingsContext.startingDoubleDefense) {
Expand Down

0 comments on commit ac7805c

Please sign in to comment.