Merge pull request #1355 from leggettc18/rando-next-chest-fixes

Randomizer: Fixes a few bugs related to chests.
This commit is contained in:
briaguya 2022-08-31 16:15:46 -04:00 committed by GitHub
commit 32c36eb5c4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -6108,7 +6108,7 @@ s32 func_8083E5A8(Player* this, GlobalContext* globalCtx) {
} }
GetItemEntry giEntry; GetItemEntry giEntry;
if (this->getItemEntry.objectId == OBJECT_INVALID) { if (this->getItemEntry.objectId == OBJECT_INVALID || (this->getItemId != this->getItemEntry.getItemId)) {
giEntry = ItemTable_Retrieve(this->getItemId); giEntry = ItemTable_Retrieve(this->getItemId);
} else { } else {
giEntry = this->getItemEntry; giEntry = this->getItemEntry;
@ -6165,7 +6165,7 @@ s32 func_8083E5A8(Player* this, GlobalContext* globalCtx) {
} }
} else if (CHECK_BTN_ALL(sControlInput->press.button, BTN_A) && !(this->stateFlags1 & PLAYER_STATE1_11) && } else if (CHECK_BTN_ALL(sControlInput->press.button, BTN_A) && !(this->stateFlags1 & PLAYER_STATE1_11) &&
!(this->stateFlags2 & PLAYER_STATE2_10)) { !(this->stateFlags2 & PLAYER_STATE2_10)) {
if (this->getItemId != GI_NONE && this->getItemEntry.objectId != OBJECT_INVALID) { if (this->getItemId != GI_NONE) {
GetItemEntry giEntry; GetItemEntry giEntry;
if (this->getItemEntry.objectId == OBJECT_INVALID) { if (this->getItemEntry.objectId == OBJECT_INVALID) {
giEntry = ItemTable_Retrieve(-this->getItemId); giEntry = ItemTable_Retrieve(-this->getItemId);
@ -9687,8 +9687,8 @@ void func_808473D4(GlobalContext* globalCtx, Player* this) {
else if ((!(this->stateFlags1 & PLAYER_STATE1_11) || (heldActor == NULL)) && else if ((!(this->stateFlags1 & PLAYER_STATE1_11) || (heldActor == NULL)) &&
(interactRangeActor != NULL) && (interactRangeActor != NULL) &&
((!sp1C && (this->getItemId == GI_NONE)) || ((!sp1C && (this->getItemId == GI_NONE)) ||
((this->getItemId < 0 && this->getItemEntry.getItemId < 0) && !(this->stateFlags1 & PLAYER_STATE1_27)))) { (this->getItemId < 0 && !(this->stateFlags1 & PLAYER_STATE1_27)))) {
if (this->getItemId < 0 && this->getItemEntry.getItemId < 0) { if (this->getItemId < 0) {
doAction = DO_ACTION_OPEN; doAction = DO_ACTION_OPEN;
} else if ((interactRangeActor->id == ACTOR_BG_TOKI_SWD) && LINK_IS_ADULT) { } else if ((interactRangeActor->id == ACTOR_BG_TOKI_SWD) && LINK_IS_ADULT) {
doAction = DO_ACTION_DROP; doAction = DO_ACTION_DROP;