Fix problems with Zelda's Letter & Weird Egg hatching (#6962)

This commit is contained in:
Philip Dubé
2026-07-22 12:24:31 +00:00
committed by GitHub
parent 6f14e7b162
commit d62c5879aa
8 changed files with 21 additions and 30 deletions
+2 -5
View File
@@ -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++;
+17
View File
@@ -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);
+1 -2
View File
@@ -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);
}