Skip to content

Commit

Permalink
Fix accounts for Deku Nut slot initialization
Browse files Browse the repository at this point in the history
  • Loading branch information
JordanLongstaff committed Jan 2, 2025
1 parent 7acc02a commit 3f6df82
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions soh/soh/SohMenuBar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1473,9 +1473,10 @@ void DrawEnhancementsMenu() {
UIWidgets::Tooltip("Fixes a bug where the Gravedigging Tour Heart Piece disappears if the area reloads");
if (UIWidgets::PaddedEnhancementCheckbox("Fix Deku Nut upgrade", CVAR_ENHANCEMENT("DekuNutUpgradeFix"),
true, false)) {
s32 expectedNutUpgrades = CUR_UPG_VALUE(UPG_NUTS) - 1;
s32 actualNutUpgrades = (Flags_GetInfTable(INFTABLE_193) ? 1 : 0) +
(Flags_GetItemGetInf(ITEMGETINF_OBTAINED_NUT_UPGRADE_FROM_STAGE) ? 1 : 0);
s32 expectedNutUpgrades = (INV_CONTENT(ITEM_NUT) == ITEM_NUT ? 1 : 0) +
(Flags_GetInfTable(INFTABLE_193) ? 1 : 0) +
(Flags_GetItemGetInf(ITEMGETINF_OBTAINED_NUT_UPGRADE_FROM_STAGE) ? 1 : 0);
s32 actualNutUpgrades = CUR_UPG_VALUE(UPG_NUTS);
if (expectedNutUpgrades != actualNutUpgrades) {
Flags_UnsetItemGetInf(ITEMGETINF_OBTAINED_NUT_UPGRADE_FROM_STAGE);
}
Expand Down

0 comments on commit 3f6df82

Please sign in to comment.