summaryrefslogtreecommitdiff
path: root/mm/src/code
diff options
context:
space:
mode:
authorGarrett Cox <garrettjcox@gmail.com>2024-10-05 23:53:13 -0500
committerGarrett Cox <garrettjcox@gmail.com>2024-10-06 00:22:28 -0500
commit41d77dd9b4095e87fce1f3ffa2ab2e1b1b04b258 (patch)
treeb83c2e9a44f5c3f55caa26291449ee2dde0b0774 /mm/src/code
parenta93f011253177647cf227669d51df201282c90f6 (diff)
Implement event queue for handling various events like giving custom items or transitions
Diffstat (limited to 'mm/src/code')
-rw-r--r--mm/src/code/z_message.c7
-rw-r--r--mm/src/code/z_parameter.c6
2 files changed, 10 insertions, 3 deletions
diff --git a/mm/src/code/z_message.c b/mm/src/code/z_message.c
index 7f0c82be5..493ae2a9f 100644
--- a/mm/src/code/z_message.c
+++ b/mm/src/code/z_message.c
@@ -3280,7 +3280,8 @@ void Message_OpenText(PlayState* play, u16 textId) {
Player* player = GET_PLAYER(play);
f32 var_fv0;
- GameInteractor_ExecuteOnOpenText(textId);
+ bool loadFromMessageTable = true;
+ GameInteractor_ExecuteOnOpenText(&textId, &loadFromMessageTable);
// BENTODO do this somewhere else
gSaveContext.options.language = LANGUAGE_ENG;
@@ -3358,7 +3359,9 @@ void Message_OpenText(PlayState* play, u16 textId) {
sCharTexScale = 1024.0f / msgCtx->textCharScale;
D_801F6B08 = 1024.0f / var_fv0;
// BENTODO all of these
- if (msgCtx->textIsCredits) {
+ if (!loadFromMessageTable) {
+ // no-op
+ } else if (msgCtx->textIsCredits) {
Message_FindCreditsMessage(play, textId);
MessageTableEntry* msgEntry = (MessageTableEntry*)font->messageStart;
msgCtx->msgLength = msgEntry->msgSize;
diff --git a/mm/src/code/z_parameter.c b/mm/src/code/z_parameter.c
index 66bb29055..13c5e2901 100644
--- a/mm/src/code/z_parameter.c
+++ b/mm/src/code/z_parameter.c
@@ -4005,7 +4005,7 @@ u8 Item_GiveImpl(PlayState* play, u8 item) {
// #region 2S2H [Enhancements] This is our wrapper around the original Item_Give function for hooking purposes
u8 Item_Give(PlayState* play, u8 item) {
- if (!GameInteractor_ShouldItemGive(item)) {
+ if (!GameInteractor_ShouldItemGive(item) || item == ITEM_SHIP) {
return ITEM_NONE;
}
@@ -4021,6 +4021,10 @@ u8 Item_CheckObtainabilityImpl(u8 item) {
u8 slot;
u8 bottleSlot;
+ if (item == ITEM_SHIP) {
+ return ITEM_NONE;
+ }
+
slot = SLOT(item);
if (item >= ITEM_DEKU_STICKS_5) {
slot = SLOT(sExtraItemBases[item - ITEM_DEKU_STICKS_5]);