summaryrefslogtreecommitdiff
path: root/soh/src/code
diff options
context:
space:
mode:
authorPhilip Dubé <159546+serprex@users.noreply.github.com>2026-07-22 12:24:31 +0000
committerGitHub <noreply@github.com>2026-07-22 12:24:31 +0000
commitd62c5879aaf4b64d68f6069cc2413c9d5f2eac92 (patch)
tree65d9cdede7dbefe6a8ff322d8a6db7926f569786 /soh/src/code
parent6f14e7b162d6b0ed77728a12b20bf33c2ca386a1 (diff)
Fix problems with Zelda's Letter & Weird Egg hatching (#6962)
Diffstat (limited to 'soh/src/code')
-rw-r--r--soh/src/code/z_kankyo.c7
-rw-r--r--soh/src/code/z_parameter.c17
-rw-r--r--soh/src/code/z_play.c3
3 files changed, 20 insertions, 7 deletions
diff --git a/soh/src/code/z_kankyo.c b/soh/src/code/z_kankyo.c
index da6b29ce2..dc25416a6 100644
--- a/soh/src/code/z_kankyo.c
+++ b/soh/src/code/z_kankyo.c
@@ -6,8 +6,6 @@
#include "soh/frame_interpolation.h"
#include "soh/OTRGlobals.h"
#include "soh/ResourceManagerHelpers.h"
-#include "soh/Enhancements/game-interactor/GameInteractor.h"
-#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h"
#include "soh/Enhancements/savestate_serialize.h"
typedef enum {
@@ -2097,9 +2095,8 @@ void func_80075B44(PlayState* play) {
gSaveContext.bgsDayCount++;
gSaveContext.dogIsLost = true;
Sfx_PlaySfxCentered(NA_SE_EV_CHICKEN_CRY_M);
- if ((Inventory_ReplaceItem(play, ITEM_WEIRD_EGG, ITEM_CHICKEN) || Inventory_HatchPocketCucco(play)) &&
- play->csCtx.state == 0 && !Player_InCsMode(play)) {
- GameInteractor_ExecuteOnCuccoOrChickenHatch();
+ if ((Inventory_HatchWeirdEgg(play) || Inventory_HatchPocketCucco(play)) && play->csCtx.state == 0 &&
+ !Player_InCsMode(play)) {
Message_StartTextbox(play, 0x3066, NULL);
}
play->envCtx.unk_E0++;
diff --git a/soh/src/code/z_parameter.c b/soh/src/code/z_parameter.c
index 8196faef9..34037b666 100644
--- a/soh/src/code/z_parameter.c
+++ b/soh/src/code/z_parameter.c
@@ -2721,6 +2721,23 @@ s32 Inventory_ConsumeFairy(PlayState* play) {
return 0;
}
+// SOH helper
+bool Inventory_HatchWeirdEgg(PlayState* play) {
+ if (!IS_RANDO) {
+ return Inventory_ReplaceItem(play, ITEM_WEIRD_EGG, ITEM_CHICKEN);
+ }
+
+ if (!LINK_IS_CHILD || !Flags_GetRandomizerInf(RAND_INF_CHILD_TRADES_HAS_WEIRD_EGG)) {
+ return 0;
+ }
+
+ Flags_UnsetRandomizerInf(RAND_INF_CHILD_TRADES_HAS_WEIRD_EGG);
+ Flags_SetRandomizerInf(RAND_INF_CHILD_TRADES_HAS_CHICKEN);
+ Inventory_ReplaceItem(play, ITEM_WEIRD_EGG, ITEM_CHICKEN);
+ return 1;
+}
+
+// SOH helper
bool Inventory_HatchPocketCucco(PlayState* play) {
if (!IS_RANDO) {
return Inventory_ReplaceItem(play, ITEM_POCKET_EGG, ITEM_POCKET_CUCCO);
diff --git a/soh/src/code/z_play.c b/soh/src/code/z_play.c
index db5c8cb0e..843fa301e 100644
--- a/soh/src/code/z_play.c
+++ b/soh/src/code/z_play.c
@@ -500,8 +500,7 @@ void Play_Init(GameState* thisx) {
gSaveContext.bgsDayCount++;
gSaveContext.dogIsLost = true;
- if (Inventory_ReplaceItem(play, ITEM_WEIRD_EGG, ITEM_CHICKEN) || Inventory_HatchPocketCucco(play)) {
- GameInteractor_ExecuteOnCuccoOrChickenHatch();
+ if (Inventory_HatchWeirdEgg(play) || Inventory_HatchPocketCucco(play)) {
Message_StartTextbox(play, 0x3066, NULL);
}