diff options
| author | Malkierian <malkierian@gmail.com> | 2023-05-21 09:13:38 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-05-21 12:13:38 -0400 |
| commit | cf711d916408f9355ca8c6507d559802318dfe44 (patch) | |
| tree | d18a4decf87f6d6e420926a5394f13d954767fe7 /soh/src/code | |
| parent | cf42057842b812c194041599e64a6b3eb956b003 (diff) | |
Initialize `gSlotAgeReqs[SLOT_TRADE_CHILD]` and `gItemAgeReqs[ITEM_MASK_BUNNY]` on load initialization according to `gMMBunnyHood` and `gTimelessEquipment` to prevent bunny hood from being unequipped from adult equips on first load. (#2904)
Move the code to change those values based on the child trade slot item to the selecting mask loop to not be setting them every frame just because you're in the inventory.
Diffstat (limited to 'soh/src/code')
| -rw-r--r-- | soh/src/code/z_play.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/soh/src/code/z_play.c b/soh/src/code/z_play.c index 9ac45cdcc..3804b5bfc 100644 --- a/soh/src/code/z_play.c +++ b/soh/src/code/z_play.c @@ -604,6 +604,15 @@ void Play_Init(GameState* thisx) { (s32)(zAllocAligned + zAllocSize) - (s32)(zAllocAligned - zAlloc)); Fault_AddClient(&D_801614B8, ZeldaArena_Display, NULL, NULL); + // In order to keep bunny hood equipped on first load, we need to pre-set the age reqs for the item and slot + if (CVarGetInteger("gMMBunnyHood", 0) || CVarGetInteger("gTimelessEquipment", 0)) { + gItemAgeReqs[ITEM_MASK_BUNNY] = 9; + if(INV_CONTENT(ITEM_TRADE_CHILD) == ITEM_MASK_BUNNY) + gSlotAgeReqs[SLOT_TRADE_CHILD] = 9; + } + else { + gItemAgeReqs[ITEM_MASK_BUNNY] = gSlotAgeReqs[SLOT_TRADE_CHILD] = 1; + } func_800304DC(play, &play->actorCtx, play->linkActorEntry); while (!func_800973FC(play, &play->roomCtx)) { |
