diff options
| author | Garrett Cox <garrettjcox@gmail.com> | 2024-10-25 02:05:21 -0500 |
|---|---|---|
| committer | Garrett Cox <garrettjcox@gmail.com> | 2024-10-25 02:05:21 -0500 |
| commit | f7dde41c6da8a35cfd9fefc9fc0f4239dee1031e (patch) | |
| tree | 343d22eaa691c08e055dd5f8f378bf6b4d25483d /mm/src/code | |
| parent | 30c9f92a7cc9c49f158a833a9d176eff70a48345 (diff) | |
New pattern for skipping Actor_OfferGetItem
Diffstat (limited to 'mm/src/code')
| -rw-r--r-- | mm/src/code/z_actor.c | 4 | ||||
| -rw-r--r-- | mm/src/code/z_msgevent.c | 6 |
2 files changed, 6 insertions, 4 deletions
diff --git a/mm/src/code/z_actor.c b/mm/src/code/z_actor.c index e9e3f1618..7e1bfb38e 100644 --- a/mm/src/code/z_actor.c +++ b/mm/src/code/z_actor.c @@ -2258,7 +2258,9 @@ s32 Actor_OfferGetItem(Actor* actor, PlayState* play, GetItemId getItemId, f32 x s16 yawDiff = actor->yawTowardsPlayer - player->actor.shape.rot.y; s32 absYawDiff = ABS_ALT(yawDiff); - if ((getItemId != GI_NONE) || (player->getItemDirection < absYawDiff)) { + if (GameInteractor_Should(VB_GIVE_ITEM_FROM_OFFER, + ((getItemId != GI_NONE) || (player->getItemDirection < absYawDiff)), + getItemId, actor)) { player->getItemId = getItemId; player->interactRangeActor = actor; player->getItemDirection = absYawDiff; diff --git a/mm/src/code/z_msgevent.c b/mm/src/code/z_msgevent.c index cf732f660..3de626f28 100644 --- a/mm/src/code/z_msgevent.c +++ b/mm/src/code/z_msgevent.c @@ -1,5 +1,4 @@ #include "global.h" -#include "2s2h/GameInteractor/GameInteractor.h" #include "2s2h/GameInteractor/GameInteractor.h" @@ -148,7 +147,7 @@ s32 MsgEvent_Cmd06(Actor* actor, PlayState* play, u8** scriptPtr, MsgEventCallba f32 yRange = fabsf(actor->playerHeightRel) + 1.0f; s16 skip = MSCRIPT_GET_16(script, 3); - if (Actor_HasParent(actor, play) || !GameInteractor_Should(VB_GIVE_ITEM_FROM_SCRIPT, true, &getItemId)) { + if (Actor_HasParent(actor, play)) { *scriptPtr += skip; } else { Actor_OfferGetItem(actor, play, getItemId, xzRange, yRange); @@ -1146,7 +1145,8 @@ s32 MsgEvent_RunScript(Actor* actor, PlayState* play, MsgScript* script, MsgEven } // Run command handler - } while (sMsgEventCmdHandlers[cmdId](actor, play, &script, callback, &scriptDone) == MSCRIPT_CONTINUE); + } while (!GameInteractor_Should(VB_EXEC_MSG_EVENT, true, cmdId, actor, &script) || + sMsgEventCmdHandlers[cmdId](actor, play, &script, callback, &scriptDone) == MSCRIPT_CONTINUE); cur = script; if (!scriptDone) { |
