Skip to content

Commit

Permalink
Fix moon child not giving item if you have FD mask.
Browse files Browse the repository at this point in the history
  • Loading branch information
PhlexPlexico committed Apr 18, 2024
1 parent 05947e4 commit 7d48433
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
2 changes: 2 additions & 0 deletions code/include/game/actor.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ namespace game::act {
EnGm = 0x0074,
// En_Hs - Grog The Chicken Man
EnHs = 0x0076,
// En_Js - Moon Children
EnJs = 0x0085,
// Cursed Man Spider House
EnSsh = 0x0090,
// Powder Keg Trial Goron
Expand Down
3 changes: 2 additions & 1 deletion code/include/rnd/savefile.h
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,8 @@ namespace rnd {
BitField<50, 1, u64> letterToKafeiGiven;
BitField<51, 1, u64> letterToMamaGiven;
BitField<52, 1, u64> pendantGiven;
BitField<53, 11, u64> unused;
BitField<53, 1, u64> enJsGivenItem;
BitField<54, 10, u64> unused;
};
GivenItemRegister givenItemChecks;
union FairyCollectRegister {
Expand Down
5 changes: 5 additions & 0 deletions code/source/rnd/item_override.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -519,6 +519,8 @@ namespace rnd {
gExtSaveData.givenItemChecks.letterToKafeiGiven = 1;
} else if (storedGetItemId == GetItemID::GI_PENDANT_OF_MEMORIES) {
gExtSaveData.givenItemChecks.pendantGiven = 1;
} else if (storedGetItemId == GetItemID::GI_MASK_FIERCE_DEITY) {
gExtSaveData.givenItemChecks.enJsGivenItem = 1;
}
}

Expand Down Expand Up @@ -959,6 +961,9 @@ namespace rnd {
if (gctx->scene == game::SceneId::GoronVillageWinter) {
auto& saveData = game::GetCommonData().save;
if (saveData.player.magic_acquired == 0 || !game::HasItem(currentItem)) return 0xFF;
} else if (currentItem == game::ItemId::FierceDeityMask) {
return givenItems.enJsGivenItem ? (int) currentItem
: (int)0xFF;
}
}
// Use the standard pointer to array as this seems to mess with
Expand Down

0 comments on commit 7d48433

Please sign in to comment.