summaryrefslogtreecommitdiff
path: root/soh/src/code
diff options
context:
space:
mode:
Diffstat (limited to 'soh/src/code')
-rw-r--r--soh/src/code/z_parameter.c17
-rw-r--r--soh/src/code/z_play.c9
2 files changed, 23 insertions, 3 deletions
diff --git a/soh/src/code/z_parameter.c b/soh/src/code/z_parameter.c
index 954ce1190..410fd22a4 100644
--- a/soh/src/code/z_parameter.c
+++ b/soh/src/code/z_parameter.c
@@ -15,6 +15,7 @@
#endif
#include "soh/Enhancements/game-interactor/GameInteractor.h"
+#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h"
#define DO_ACTION_TEX_WIDTH() 48
@@ -1706,7 +1707,12 @@ u8 Return_Item_Entry(GetItemEntry itemEntry, ItemID returnItem ) {
// Processes Item_Give returns
u8 Return_Item(u8 itemID, ModIndex modId, ItemID returnItem) {
- uint32_t get = GetGIID(itemID);
+ // ITEM_SOLD_OUT doesn't have an ItemTable entry, so pass custom entry instead
+ if (itemID == ITEM_SOLD_OUT) {
+ GetItemEntry gie = { ITEM_SOLD_OUT, 0, 0, 0, 0, 0, 0, 0, false, ITEM_FROM_NPC, ITEM_CATEGORY_LESSER, NULL };
+ return Return_Item_Entry(gie, returnItem);
+ }
+ int32_t get = GetGIID(itemID);
if (get == -1) {
modId = MOD_RANDOMIZER;
get = itemID;
@@ -6158,8 +6164,13 @@ void Interface_Update(PlayState* play) {
u16 tempSaleMod = gSaveContext.pendingSaleMod;
gSaveContext.pendingSale = ITEM_NONE;
gSaveContext.pendingSaleMod = MOD_NONE;
- if (tempSaleMod == 0) {
- tempSaleItem = GetGIID(tempSaleItem);
+ if (tempSaleMod == MOD_NONE) {
+ s16 giid = GetGIID(tempSaleItem);
+ if (giid == -1) {
+ tempSaleMod = MOD_RANDOMIZER;
+ } else {
+ tempSaleItem = giid;
+ }
}
GameInteractor_ExecuteOnSaleEndHooks(ItemTable_RetrieveEntry(tempSaleMod, tempSaleItem));
}
diff --git a/soh/src/code/z_play.c b/soh/src/code/z_play.c
index e0352a7b3..7a9d568bc 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)) {