Fixes Switch/Wii U crashes with Wonder Rupees and Bottleable Entities (#1360)

* Reorders switch statement to prevent some code that shouldn't execute.

* Potentially fixes bottleable entities crash

* Solves lack of ItemEntry for GI_MAX

* Adds comment clarifying new GetItemEntry
This commit is contained in:
Christopher Leggett 2022-09-02 13:19:12 -04:00 committed by GitHub
parent 584a4ad818
commit 64aca78450
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 7 additions and 8 deletions

View file

@ -515,13 +515,13 @@ void EnItem00_Init(Actor* thisx, GlobalContext* globalCtx) {
}
if (!Actor_HasParent(&this->actor, globalCtx)) {
if (!gSaveContext.n64ddFlag) {
if (getItemId != GI_NONE) {
if (getItemId != GI_NONE) {
if (!gSaveContext.n64ddFlag) {
func_8002F554(&this->actor, globalCtx, getItemId);
} else {
getItem = Randomizer_GetRandomizedItem(getItemId, this->actor.id, this->ogParams, globalCtx->sceneNum);
GiveItemEntryFromActorWithFixedRange(&this->actor, globalCtx, getItem);
}
} else {
getItem = Randomizer_GetRandomizedItem(getItemId, this->actor.id, this->ogParams, globalCtx->sceneNum);
GiveItemEntryFromActorWithFixedRange(&this->actor, globalCtx, getItem);
}
}