Fix Mido without Emerald softlock (#4824)

* * fixes softlock when talking to Mido without Kokiri Emerald after killing Gohma

* * moved scene check to hook
* moved vanilla conditioon into GameInteractor_Should

* * corrected hook condition
* removed 'this'

* * reverted GameInteractor and hook_handlers
* changed actor to use existing hook

* * updated kokiri emerald conditions

* * missed parentheses
This commit is contained in:
Fredrik Andreasson 2025-01-11 07:14:31 +01:00 committed by GitHub
parent 8dc2b0cec2
commit 3b26bd0402
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -618,13 +618,13 @@ void func_80AAB5A4(EnMd* this, PlayState* play) {
if (play->sceneNum != SCENE_MIDOS_HOUSE) { if (play->sceneNum != SCENE_MIDOS_HOUSE) {
if (CVarGetInteger(CVAR_ENHANCEMENT("DisableKokiriDrawDistance"), 0) != 0) { if (CVarGetInteger(CVAR_ENHANCEMENT("DisableKokiriDrawDistance"), 0) != 0) {
temp = (CHECK_QUEST_ITEM(QUEST_KOKIRI_EMERALD) && !Flags_GetEventChkInf(EVENTCHKINF_SPOKE_TO_MIDO_AFTER_DEKU_TREES_DEATH) && temp = (GameInteractor_Should(VB_MIDO_CONSIDER_DEKU_TREE_DEAD, CHECK_QUEST_ITEM(QUEST_KOKIRI_EMERALD)) &&
(play->sceneNum == SCENE_KOKIRI_FOREST)) !Flags_GetEventChkInf(EVENTCHKINF_SPOKE_TO_MIDO_AFTER_DEKU_TREES_DEATH) && (play->sceneNum == SCENE_KOKIRI_FOREST))
? 100.0f ? 100.0f
: 32767.0f; : 32767.0f;
} else { } else {
temp = (CHECK_QUEST_ITEM(QUEST_KOKIRI_EMERALD) && !Flags_GetEventChkInf(EVENTCHKINF_SPOKE_TO_MIDO_AFTER_DEKU_TREES_DEATH) && temp = (GameInteractor_Should(VB_MIDO_CONSIDER_DEKU_TREE_DEAD, CHECK_QUEST_ITEM(QUEST_KOKIRI_EMERALD)) &&
(play->sceneNum == SCENE_KOKIRI_FOREST)) !Flags_GetEventChkInf(EVENTCHKINF_SPOKE_TO_MIDO_AFTER_DEKU_TREES_DEATH) && (play->sceneNum == SCENE_KOKIRI_FOREST))
? 100.0f ? 100.0f
: 400.0f; : 400.0f;
} }
@ -661,7 +661,7 @@ void EnMd_Init(Actor* thisx, PlayState* play) {
if (((play->sceneNum == SCENE_KOKIRI_FOREST) && !Flags_GetEventChkInf(EVENTCHKINF_SHOWED_MIDO_SWORD_SHIELD)) || if (((play->sceneNum == SCENE_KOKIRI_FOREST) && !Flags_GetEventChkInf(EVENTCHKINF_SHOWED_MIDO_SWORD_SHIELD)) ||
((play->sceneNum == SCENE_KOKIRI_FOREST) && Flags_GetEventChkInf(EVENTCHKINF_SHOWED_MIDO_SWORD_SHIELD) && ((play->sceneNum == SCENE_KOKIRI_FOREST) && Flags_GetEventChkInf(EVENTCHKINF_SHOWED_MIDO_SWORD_SHIELD) &&
CHECK_QUEST_ITEM(QUEST_KOKIRI_EMERALD)) || GameInteractor_Should(VB_MIDO_CONSIDER_DEKU_TREE_DEAD, CHECK_QUEST_ITEM(QUEST_KOKIRI_EMERALD))) ||
((play->sceneNum == SCENE_LOST_WOODS) && !Flags_GetEventChkInf(EVENTCHKINF_PLAYED_SARIAS_SONG_FOR_MIDO_AS_ADULT))) { ((play->sceneNum == SCENE_LOST_WOODS) && !Flags_GetEventChkInf(EVENTCHKINF_PLAYED_SARIAS_SONG_FOR_MIDO_AS_ADULT))) {
this->actor.home.pos = this->actor.world.pos; this->actor.home.pos = this->actor.world.pos;
this->actionFunc = func_80AAB948; this->actionFunc = func_80AAB948;
@ -727,8 +727,8 @@ void func_80AAB948(EnMd* this, PlayState* play) {
(GameInteractor_Should(VB_MOVE_MIDO_IN_KOKIRI_FOREST, this->interactInfo.talkState == NPC_TALK_STATE_ACTION, this) && play->sceneNum == SCENE_KOKIRI_FOREST) || (GameInteractor_Should(VB_MOVE_MIDO_IN_KOKIRI_FOREST, this->interactInfo.talkState == NPC_TALK_STATE_ACTION, this) && play->sceneNum == SCENE_KOKIRI_FOREST) ||
this->interactInfo.talkState == NPC_TALK_STATE_ACTION this->interactInfo.talkState == NPC_TALK_STATE_ACTION
) { ) {
if (CHECK_QUEST_ITEM(QUEST_KOKIRI_EMERALD) && !Flags_GetEventChkInf(EVENTCHKINF_SPOKE_TO_MIDO_AFTER_DEKU_TREES_DEATH) && if (GameInteractor_Should(VB_MIDO_CONSIDER_DEKU_TREE_DEAD, CHECK_QUEST_ITEM(QUEST_KOKIRI_EMERALD)) &&
(play->sceneNum == SCENE_KOKIRI_FOREST)) { !Flags_GetEventChkInf(EVENTCHKINF_SPOKE_TO_MIDO_AFTER_DEKU_TREES_DEATH) && (play->sceneNum == SCENE_KOKIRI_FOREST)) {
play->msgCtx.msgMode = MSGMODE_PAUSED; play->msgCtx.msgMode = MSGMODE_PAUSED;
} }
@ -794,8 +794,10 @@ void func_80AABD0C(EnMd* this, PlayState* play) {
return; return;
} }
if (CHECK_QUEST_ITEM(QUEST_KOKIRI_EMERALD) && !Flags_GetEventChkInf(EVENTCHKINF_SPOKE_TO_MIDO_AFTER_DEKU_TREES_DEATH) && if (
(play->sceneNum == SCENE_KOKIRI_FOREST)) { GameInteractor_Should(VB_MIDO_CONSIDER_DEKU_TREE_DEAD, CHECK_QUEST_ITEM(QUEST_KOKIRI_EMERALD)) &&
!Flags_GetEventChkInf(EVENTCHKINF_SPOKE_TO_MIDO_AFTER_DEKU_TREES_DEATH) && (play->sceneNum == SCENE_KOKIRI_FOREST)
) {
Message_CloseTextbox(play); Message_CloseTextbox(play);
Flags_SetEventChkInf(EVENTCHKINF_SPOKE_TO_MIDO_AFTER_DEKU_TREES_DEATH); Flags_SetEventChkInf(EVENTCHKINF_SPOKE_TO_MIDO_AFTER_DEKU_TREES_DEATH);
Actor_Kill(&this->actor); Actor_Kill(&this->actor);