summaryrefslogtreecommitdiff
path: root/mm/2s2h/Rando/ActorBehavior/ObjTsubo.cpp
diff options
context:
space:
mode:
authorGarrett Cox <garrettjcox@gmail.com>2024-10-25 08:25:21 -0500
committerGarrett Cox <garrettjcox@gmail.com>2024-10-25 09:25:35 -0500
commit89e3bcac8ec64066a9cc7b042a46b7724fbe92fe (patch)
treeef40b0a65d41006c4d3fba592620e840189598bc /mm/2s2h/Rando/ActorBehavior/ObjTsubo.cpp
parentf7dde41c6da8a35cfd9fefc9fc0f4239dee1031e (diff)
COND_HOOK macros
Diffstat (limited to 'mm/2s2h/Rando/ActorBehavior/ObjTsubo.cpp')
-rw-r--r--mm/2s2h/Rando/ActorBehavior/ObjTsubo.cpp35
1 files changed, 11 insertions, 24 deletions
diff --git a/mm/2s2h/Rando/ActorBehavior/ObjTsubo.cpp b/mm/2s2h/Rando/ActorBehavior/ObjTsubo.cpp
index 7231a68b4..c419c723a 100644
--- a/mm/2s2h/Rando/ActorBehavior/ObjTsubo.cpp
+++ b/mm/2s2h/Rando/ActorBehavior/ObjTsubo.cpp
@@ -851,33 +851,20 @@ RandoCheckId IdentifyPot(Actor* actor) {
}
void Rando::ActorBehavior::InitObjTsuboBehavior() {
- static uint32_t onActorInit = 0;
- static uint32_t shouldHookId1 = 0;
- GameInteractor::Instance->UnregisterGameHookForID<GameInteractor::OnActorInit>(onActorInit);
- GameInteractor::Instance->UnregisterGameHookForID<GameInteractor::ShouldVanillaBehavior>(shouldHookId1);
-
- onActorInit = 0;
- shouldHookId1 = 0;
-
- if (!IS_RANDO) {
- return;
- }
-
- onActorInit =
- GameInteractor::Instance->RegisterGameHookForID<GameInteractor::OnActorInit>(ACTOR_OBJ_TSUBO, [](Actor* actor) {
- RandoCheckId randoCheckId = IdentifyPot(actor);
- if (randoCheckId == RC_UNKNOWN) {
- return;
- }
+ COND_ID_HOOK(OnActorInit, ACTOR_OBJ_TSUBO, IS_RANDO, [](Actor* actor) {
+ RandoCheckId randoCheckId = IdentifyPot(actor);
+ if (randoCheckId == RC_UNKNOWN) {
+ return;
+ }
- if (!RANDO_SAVE_CHECKS[randoCheckId].shuffled || RANDO_SAVE_CHECKS[randoCheckId].eligible) {
- return;
- }
+ if (!RANDO_SAVE_CHECKS[randoCheckId].shuffled || RANDO_SAVE_CHECKS[randoCheckId].eligible) {
+ return;
+ }
- actor->home.rot.x = randoCheckId;
- });
+ actor->home.rot.x = randoCheckId;
+ });
- shouldHookId1 = REGISTER_VB_SHOULD(VB_POT_DROP_COLLECTIBLE, {
+ COND_VB_SHOULD(VB_POT_DROP_COLLECTIBLE, IS_RANDO, {
Actor* actor = va_arg(args, Actor*);
RandoCheckId randoCheckId = (RandoCheckId)actor->home.rot.x;
if (randoCheckId == RC_UNKNOWN) {