diff --git a/soh/soh/OTRGlobals.cpp b/soh/soh/OTRGlobals.cpp index 549b69ed1ef..36101e05e4f 100644 --- a/soh/soh/OTRGlobals.cpp +++ b/soh/soh/OTRGlobals.cpp @@ -1513,13 +1513,15 @@ extern "C" int Randomizer_GetCustomGetItemMessage(GetItemID giid, char* buffer, return CopyStringToCharBuffer(getItemText, buffer, maxBufferSize); } -extern "C" int CustomMessage_RetrieveIfExists(GlobalContext* globalCtx, char* buffer, const int maxBufferSize) { +extern "C" int CustomMessage_RetrieveIfExists(GlobalContext* globalCtx) { MessageContext* msgCtx = &globalCtx->msgCtx; Font* font = &msgCtx->font; + char* buffer = font->msgBuf; + const int maxBufferSize = sizeof(font->msgBuf); if (gSaveContext.n64ddFlag) { if (msgCtx->textId == 0xF8) { if (msgCtx->msgLength = font->msgLength = Randomizer_GetCustomGetItemMessage( - (GetItemID)GET_PLAYER(globalCtx)->getItemId, font->msgBuf, sizeof(font->msgBuf))) { + (GetItemID)GET_PLAYER(globalCtx)->getItemId, buffer, maxBufferSize)) { font->charTexBuf[0] = 0x23; return true; } else { diff --git a/soh/soh/OTRGlobals.h b/soh/soh/OTRGlobals.h index 0110d7ad17e..8f46d13fc76 100644 --- a/soh/soh/OTRGlobals.h +++ b/soh/soh/OTRGlobals.h @@ -97,7 +97,7 @@ s32 GetItemIDFromGetItemID(s32 getItemId); s32 GetRandomizedItemId(GetItemID ogId, s16 actorId, s16 actorParams, s16 sceneNum); s32 GetRandomizedItemIdFromKnownCheck(RandomizerCheck randomizerCheck, GetItemID ogId); int Randomizer_GetCustomGetItemMessage(GetItemID giid, char* buffer, const int maxBufferSize); -int CustomMessage_RetrieveIfExists(GlobalContext* globalCtx, char* buffer, const int maxBufferSize); +int CustomMessage_RetrieveIfExists(GlobalContext* globalCtx); #endif #endif diff --git a/soh/src/code/z_message_PAL.c b/soh/src/code/z_message_PAL.c index 432c05cfd5a..f0ce90fbd78 100644 --- a/soh/src/code/z_message_PAL.c +++ b/soh/src/code/z_message_PAL.c @@ -1662,7 +1662,7 @@ void Message_OpenText(GlobalContext* globalCtx, u16 textId) { gSaveContext.eventInf[0] = gSaveContext.eventInf[1] = gSaveContext.eventInf[2] = gSaveContext.eventInf[3] = 0; } - if (CustomMessage_RetrieveIfExists(globalCtx, font->msgBuf, sizeof(font->msgBuf))) { + if (CustomMessage_RetrieveIfExists(globalCtx)) { osSyncPrintf("Found custom message"); } else if (sTextIsCredits) { Message_FindCreditsMessage(globalCtx, textId);