From 105eac4e533b30eaab60eefa0ccba2197703fb10 Mon Sep 17 00:00:00 2001 From: Christopher Leggett Date: Sat, 13 Aug 2022 11:49:03 -0400 Subject: [PATCH] Sets global modIndex to MOD_NONE on scene load Fixes a crash when buying items in shops due to them not triggering the rando code that normally sets these items. May have also been crashing vanilla playthroughs. --- soh/soh/z_play_otr.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/soh/soh/z_play_otr.cpp b/soh/soh/z_play_otr.cpp index 9921d3050b..8e7b210030 100644 --- a/soh/soh/z_play_otr.cpp +++ b/soh/soh/z_play_otr.cpp @@ -60,6 +60,7 @@ void OTRGameplay_InitScene(GlobalContext* globalCtx, s32 spawn) { globalCtx->cUpElfMsgs = nullptr; globalCtx->setupPathList = nullptr; globalCtx->numSetupActors = 0; + OTRGlobals::Instance->getItemModIndex = MOD_NONE; Object_InitBank(globalCtx, &globalCtx->objectCtx); LightContext_Init(globalCtx, &globalCtx->lightCtx); TransitionActor_InitContext(&globalCtx->state, &globalCtx->transiActorCtx);