From d510d8cde04345e4b0a52ab0d1b2f41b7ee51c3d Mon Sep 17 00:00:00 2001 From: Sarge-117 Date: Sun, 28 Aug 2022 09:45:00 -0700 Subject: [PATCH] Comment clarity --- soh/src/overlays/actors/ovl_Bg_Breakwall/z_bg_breakwall.c | 6 +++--- soh/src/overlays/actors/ovl_Bg_Breakwall/z_bg_breakwall.h | 2 +- .../actors/ovl_Obj_Lightswitch/z_obj_lightswitch.c | 7 ++++++- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/soh/src/overlays/actors/ovl_Bg_Breakwall/z_bg_breakwall.c b/soh/src/overlays/actors/ovl_Bg_Breakwall/z_bg_breakwall.c index 2c29e1725d..6d816404c3 100644 --- a/soh/src/overlays/actors/ovl_Bg_Breakwall/z_bg_breakwall.c +++ b/soh/src/overlays/actors/ovl_Bg_Breakwall/z_bg_breakwall.c @@ -257,7 +257,7 @@ void BgBreakwall_WaitForObject(BgBreakwall* this, GlobalContext* globalCtx) { * despawn itself. */ void BgBreakwall_Wait(BgBreakwall* this, GlobalContext* globalCtx) { - bool blueFireArrowCheck = false; + bool blueFireArrowHit = false; // If "Blue Fire Arrows" enabled, check this collider for a hit if (enhancedIceArrow) { if (this->colliderIceArrow.base.acFlags & AC_HIT) { @@ -266,13 +266,13 @@ void BgBreakwall_Wait(BgBreakwall* this, GlobalContext* globalCtx) { if (this->colliderIceArrow.base.ac->child != NULL && this->colliderIceArrow.base.ac->child->id == ACTOR_ARROW_ICE) { - blueFireArrowCheck = true; + blueFireArrowHit = true; } } } } - if (this->collider.base.acFlags & 2 || blueFireArrowCheck) { + if (this->collider.base.acFlags & 2 || blueFireArrowHit) { Vec3f effectPos; s32 wallType = ((this->dyna.actor.params >> 13) & 3) & 0xFF; diff --git a/soh/src/overlays/actors/ovl_Bg_Breakwall/z_bg_breakwall.h b/soh/src/overlays/actors/ovl_Bg_Breakwall/z_bg_breakwall.h index 7d2606195d..09089469ee 100644 --- a/soh/src/overlays/actors/ovl_Bg_Breakwall/z_bg_breakwall.h +++ b/soh/src/overlays/actors/ovl_Bg_Breakwall/z_bg_breakwall.h @@ -14,7 +14,7 @@ typedef struct BgBreakwall { /* 0x0168 */ s8 colType; /* 0x0169 */ s8 bankIndex; /* 0x016C */ ColliderQuad collider; - ColliderQuad colliderIceArrow; // Blue Fire Arrows + ColliderQuad colliderIceArrow; // For "Blue Fire Arrows" enhancement /* 0x01EC */ BgBreakwallActionFunc actionFunc; } BgBreakwall; // size = 0x01F0 diff --git a/soh/src/overlays/actors/ovl_Obj_Lightswitch/z_obj_lightswitch.c b/soh/src/overlays/actors/ovl_Obj_Lightswitch/z_obj_lightswitch.c index 3335aa340a..65c39a54ef 100644 --- a/soh/src/overlays/actors/ovl_Obj_Lightswitch/z_obj_lightswitch.c +++ b/soh/src/overlays/actors/ovl_Obj_Lightswitch/z_obj_lightswitch.c @@ -249,12 +249,15 @@ void ObjLightswitch_Destroy(Actor* thisx, GlobalContext* globalCtx2) { // Unset the switch flag on room exit to prevent the rock in the wall from // vanishing on its own after activating the sun switch by Light Arrow + // Also prevents the cobra mirror from rotating to face the sun on its own + // Makes sun switches temporary when activated by Light Arrows (will turn off on room exit) if (activatedByLightArrow && enhancedLightArrow) { switch (this->actor.params >> 4 & 3) { case OBJLIGHTSWITCH_TYPE_STAY_ON: case OBJLIGHTSWITCH_TYPE_2: case OBJLIGHTSWITCH_TYPE_1: - if (this->actor.room != 25) { // Don't unset the flag for the chain platform + // Except for this one, because we want the chain platform to stay down for good + if (this->actor.room != 25) { Flags_UnsetSwitch(globalCtx, this->actor.params >> 8 & 0x3F); } activatedByLightArrow = false; @@ -359,6 +362,7 @@ void ObjLightswitch_On(ObjLightswitch* this, GlobalContext* globalCtx) { if (!Flags_GetSwitch(globalCtx, this->actor.params >> 8 & 0x3F)) { ObjLightswitch_SetupTurnOff(this); } + // If hit by sunlight after already being turned on, then behave as if originally activated by sunlight if (enhancedLightArrow && (this->collider.base.acFlags & AC_HIT)) { if (this->collider.base.ac != NULL && this->collider.base.ac->id != ACTOR_EN_ARROW) { activatedByLightArrow = false; @@ -372,6 +376,7 @@ void ObjLightswitch_On(ObjLightswitch* this, GlobalContext* globalCtx) { } break; case OBJLIGHTSWITCH_TYPE_2: + // If hit by sunlight after already being turned on, then behave as if originally activated by sunlight if (enhancedLightArrow && (this->collider.base.acFlags & AC_HIT)) { if (this->collider.base.ac != NULL && this->collider.base.ac->id != ACTOR_EN_ARROW) { activatedByLightArrow = false;