diff --git a/include/functions.h b/include/functions.h index 5bfbda3a2c..3dc812c813 100644 --- a/include/functions.h +++ b/include/functions.h @@ -1421,7 +1421,7 @@ void TransitionCircle_Draw(void* thisx, Gfx** gfxP); s32 TransitionCircle_IsDone(void* thisx); void TransitionCircle_SetType(void* thisx, s32 type); void TransitionCircle_SetColor(void* thisx, u32 color); -void TransitionCircle_SetEnvColor(void* thisx, u32 color); +void TransitionCircle_SetUnkColor(void* thisx, u32 color); void TransitionFade_Start(void* this); void* TransitionFade_Init(void* this); void TransitionFade_Destroy(void* this); diff --git a/include/z64.h b/include/z64.h index 27b535f555..e6b03ebbd9 100644 --- a/include/z64.h +++ b/include/z64.h @@ -1101,8 +1101,7 @@ typedef struct { TransitionCircle circle; TransitionTriforce triforce; TransitionWipe wipe; - char data[0x228]; - }; + } instanceData; /* 0x228 */ s32 transitionType; /* 0x22C */ void* (*init)(void* transition); /* 0x230 */ void (*destroy)(void* transition); @@ -1111,7 +1110,7 @@ typedef struct { /* 0x23C */ void (*start)(void* transition); /* 0x240 */ void (*setType)(void* transition, s32 type); /* 0x244 */ void (*setColor)(void* transition, u32 color); - /* 0x248 */ void (*setEnvColor)(void* transition, u32 color); + /* 0x248 */ void (*setUnkColor)(void* transition, u32 color); /* 0x24C */ s32 (*isDone)(void* transition); } TransitionContext; // size = 0x250 diff --git a/include/z64transition.h b/include/z64transition.h index 2f4436e760..17d20d3f4e 100644 --- a/include/z64transition.h +++ b/include/z64transition.h @@ -47,7 +47,7 @@ typedef struct { typedef struct { /* 0x000 */ Color_RGBA8_u32 color; - /* 0x004 */ Color_RGBA8_u32 envColor; + /* 0x004 */ Color_RGBA8_u32 unkColor; /* 0x008 */ s32 texX; /* 0x00C */ s32 texY; /* 0x010 */ s32 speed; diff --git a/src/code/z_camera.c b/src/code/z_camera.c index cc2c65b54b..3415f783df 100644 --- a/src/code/z_camera.c +++ b/src/code/z_camera.c @@ -5302,7 +5302,7 @@ s32 Camera_Unique9(Camera* camera) { camera->roll = anim->rollTarget; break; case 16: - // same as 16, but don't unset bit 0x8 on unk_14C + // same as 21, but don't unset bit 0x8 on unk_14C if (anim->unk_38 == 0) { anim->unk_38 = 1; } else if (camera->unk_14C & 8) { diff --git a/src/code/z_fbdemo_circle.c b/src/code/z_fbdemo_circle.c index a4d57564f5..1fd6cabe27 100644 --- a/src/code/z_fbdemo_circle.c +++ b/src/code/z_fbdemo_circle.c @@ -204,8 +204,8 @@ void TransitionCircle_SetColor(void* thisx, u32 color) { this->color.rgba = color; } -void TransitionCircle_SetEnvColor(void* thisx, u32 envColor) { +void TransitionCircle_SetUnkColor(void* thisx, u32 unkColor) { TransitionCircle* this = (TransitionCircle*)thisx; - this->envColor.rgba = envColor; + this->unkColor.rgba = unkColor; } diff --git a/src/code/z_play.c b/src/code/z_play.c index b5afd0e223..edb7d6a0c8 100644 --- a/src/code/z_play.c +++ b/src/code/z_play.c @@ -60,7 +60,7 @@ void Gameplay_SetupTransition(GlobalContext* globalCtx, s32 transitionType) { transitionCtx->update = TransitionCircle_Update; transitionCtx->setType = TransitionCircle_SetType; transitionCtx->setColor = TransitionCircle_SetColor; - transitionCtx->setEnvColor = TransitionCircle_SetEnvColor; + transitionCtx->setUnkColor = TransitionCircle_SetUnkColor; } else { switch (transitionCtx->transitionType) { case TRANS_TYPE_TRIFORCE: @@ -72,7 +72,7 @@ void Gameplay_SetupTransition(GlobalContext* globalCtx, s32 transitionType) { transitionCtx->update = TransitionTriforce_Update; transitionCtx->setType = TransitionTriforce_SetType; transitionCtx->setColor = TransitionTriforce_SetColor; - transitionCtx->setEnvColor = NULL; + transitionCtx->setUnkColor = NULL; break; case TRANS_TYPE_WIPE: @@ -85,7 +85,7 @@ void Gameplay_SetupTransition(GlobalContext* globalCtx, s32 transitionType) { transitionCtx->update = TransitionWipe_Update; transitionCtx->setType = TransitionWipe_SetType; transitionCtx->setColor = TransitionWipe_SetColor; - transitionCtx->setEnvColor = NULL; + transitionCtx->setUnkColor = NULL; break; case TRANS_TYPE_FADE_BLACK: @@ -106,7 +106,7 @@ void Gameplay_SetupTransition(GlobalContext* globalCtx, s32 transitionType) { transitionCtx->update = TransitionFade_Update; transitionCtx->setType = TransitionFade_SetType; transitionCtx->setColor = TransitionFade_SetColor; - transitionCtx->setEnvColor = NULL; + transitionCtx->setUnkColor = NULL; break; case TRANS_TYPE_FILL_WHITE2: @@ -170,7 +170,7 @@ void Gameplay_Destroy(GameState* thisx) { } if (globalCtx->transitionMode == TRANS_MODE_INSTANCE_RUNNING) { - globalCtx->transitionCtx.destroy(&globalCtx->transitionCtx.data); + globalCtx->transitionCtx.destroy(&globalCtx->transitionCtx.instanceData); func_800BC88C(globalCtx); globalCtx->transitionMode = TRANS_MODE_OFF; } @@ -515,11 +515,11 @@ void Gameplay_Update(GlobalContext* globalCtx) { } // fallthrough case TRANS_MODE_INSTANCE_INIT: - globalCtx->transitionCtx.init(&globalCtx->transitionCtx.data); + globalCtx->transitionCtx.init(&globalCtx->transitionCtx.instanceData); // circle types if ((globalCtx->transitionCtx.transitionType >> 5) == 1) { - globalCtx->transitionCtx.setType(&globalCtx->transitionCtx.data, + globalCtx->transitionCtx.setType(&globalCtx->transitionCtx.instanceData, globalCtx->transitionCtx.transitionType | TC_SET_PARAMS); } @@ -549,40 +549,44 @@ void Gameplay_Update(GlobalContext* globalCtx) { (globalCtx->transitionCtx.transitionType == TRANS_TYPE_FADE_WHITE_SLOW) || (globalCtx->transitionCtx.transitionType == TRANS_TYPE_FADE_WHITE_CS_DELAYED) || (globalCtx->transitionCtx.transitionType == TRANS_TYPE_FADE_WHITE_INSTANT)) { - globalCtx->transitionCtx.setColor(&globalCtx->transitionCtx.data, RGBA8(160, 160, 160, 255)); - if (globalCtx->transitionCtx.setEnvColor != NULL) { - globalCtx->transitionCtx.setEnvColor(&globalCtx->transitionCtx.data, + globalCtx->transitionCtx.setColor(&globalCtx->transitionCtx.instanceData, + RGBA8(160, 160, 160, 255)); + if (globalCtx->transitionCtx.setUnkColor != NULL) { + globalCtx->transitionCtx.setUnkColor(&globalCtx->transitionCtx.instanceData, RGBA8(160, 160, 160, 255)); } } else if (globalCtx->transitionCtx.transitionType == TRANS_TYPE_FADE_GREEN) { - globalCtx->transitionCtx.setColor(&globalCtx->transitionCtx.data, RGBA8(140, 140, 100, 255)); + globalCtx->transitionCtx.setColor(&globalCtx->transitionCtx.instanceData, + RGBA8(140, 140, 100, 255)); - if (globalCtx->transitionCtx.setEnvColor != NULL) { - globalCtx->transitionCtx.setEnvColor(&globalCtx->transitionCtx.data, + if (globalCtx->transitionCtx.setUnkColor != NULL) { + globalCtx->transitionCtx.setUnkColor(&globalCtx->transitionCtx.instanceData, RGBA8(140, 140, 100, 255)); } } else if (globalCtx->transitionCtx.transitionType == TRANS_TYPE_FADE_BLUE) { - globalCtx->transitionCtx.setColor(&globalCtx->transitionCtx.data, RGBA8(70, 100, 110, 255)); + globalCtx->transitionCtx.setColor(&globalCtx->transitionCtx.instanceData, + RGBA8(70, 100, 110, 255)); - if (globalCtx->transitionCtx.setEnvColor != NULL) { - globalCtx->transitionCtx.setEnvColor(&globalCtx->transitionCtx.data, + if (globalCtx->transitionCtx.setUnkColor != NULL) { + globalCtx->transitionCtx.setUnkColor(&globalCtx->transitionCtx.instanceData, RGBA8(70, 100, 110, 255)); } } else { - globalCtx->transitionCtx.setColor(&globalCtx->transitionCtx.data, RGBA8(0, 0, 0, 0)); + globalCtx->transitionCtx.setColor(&globalCtx->transitionCtx.instanceData, RGBA8(0, 0, 0, 0)); - if (globalCtx->transitionCtx.setEnvColor != NULL) { - globalCtx->transitionCtx.setEnvColor(&globalCtx->transitionCtx.data, RGBA8(0, 0, 0, 0)); + if (globalCtx->transitionCtx.setUnkColor != NULL) { + globalCtx->transitionCtx.setUnkColor(&globalCtx->transitionCtx.instanceData, + RGBA8(0, 0, 0, 0)); } } if (globalCtx->transitionTrigger == TRANS_TRIGGER_END) { - globalCtx->transitionCtx.setType(&globalCtx->transitionCtx.data, 1); + globalCtx->transitionCtx.setType(&globalCtx->transitionCtx.instanceData, 1); } else { - globalCtx->transitionCtx.setType(&globalCtx->transitionCtx.data, 2); + globalCtx->transitionCtx.setType(&globalCtx->transitionCtx.instanceData, 2); } - globalCtx->transitionCtx.start(&globalCtx->transitionCtx); + globalCtx->transitionCtx.start(&globalCtx->transitionCtx.instanceData); if (globalCtx->transitionCtx.transitionType == TRANS_TYPE_FADE_WHITE_CS_DELAYED) { globalCtx->transitionMode = TRANS_MODE_INSTANCE_WAIT; @@ -592,10 +596,10 @@ void Gameplay_Update(GlobalContext* globalCtx) { break; case TRANS_MODE_INSTANCE_RUNNING: - if (globalCtx->transitionCtx.isDone(&globalCtx->transitionCtx)) { + if (globalCtx->transitionCtx.isDone(&globalCtx->transitionCtx.instanceData)) { if (globalCtx->transitionCtx.transitionType >= TRANS_TYPE_MAX) { if (globalCtx->transitionTrigger == TRANS_TRIGGER_END) { - globalCtx->transitionCtx.destroy(&globalCtx->transitionCtx); + globalCtx->transitionCtx.destroy(&globalCtx->transitionCtx.instanceData); func_800BC88C(globalCtx); globalCtx->transitionMode = TRANS_MODE_OFF; } @@ -613,7 +617,7 @@ void Gameplay_Update(GlobalContext* globalCtx) { SET_NEXT_GAMESTATE(&globalCtx->state, FileChoose_Init, FileChooseContext); } } else { - globalCtx->transitionCtx.destroy(&globalCtx->transitionCtx); + globalCtx->transitionCtx.destroy(&globalCtx->transitionCtx.instanceData); func_800BC88C(globalCtx); globalCtx->transitionMode = TRANS_MODE_OFF; @@ -626,7 +630,7 @@ void Gameplay_Update(GlobalContext* globalCtx) { globalCtx->transitionTrigger = TRANS_TRIGGER_OFF; } else { - globalCtx->transitionCtx.update(&globalCtx->transitionCtx.data, R_UPDATE_RATE); + globalCtx->transitionCtx.update(&globalCtx->transitionCtx.instanceData, R_UPDATE_RATE); } break; } @@ -1161,7 +1165,7 @@ void Gameplay_Draw(GlobalContext* globalCtx) { SET_FULLSCREEN_VIEWPORT(&view); View_ApplyTo(&view, VIEW_ALL, &gfxP); - globalCtx->transitionCtx.draw(&globalCtx->transitionCtx.data, &gfxP); + globalCtx->transitionCtx.draw(&globalCtx->transitionCtx.instanceData, &gfxP); } TransitionFade_Draw(&globalCtx->transitionFade, &gfxP); diff --git a/src/overlays/actors/ovl_En_Am/z_en_am.c b/src/overlays/actors/ovl_En_Am/z_en_am.c index 690f6563c1..839d2fa203 100644 --- a/src/overlays/actors/ovl_En_Am/z_en_am.c +++ b/src/overlays/actors/ovl_En_Am/z_en_am.c @@ -799,7 +799,7 @@ void EnAm_UpdateDamage(EnAm* this, GlobalContext* globalCtx) { if (this->dyna.actor.colChkInfo.damageEffect != AM_DMGEFF_MAGIC_FIRE_LIGHT) { this->unk_264 = 0; this->damageEffect = this->dyna.actor.colChkInfo.damageEffect; - Actor_SetDropFlag(&this->dyna.actor, &this->hurtCollider.info, 0); + Actor_SetDropFlag(&this->dyna.actor, &this->hurtCollider.info, false); if ((this->dyna.actor.colChkInfo.damageEffect == AM_DMGEFF_NUT) || (this->dyna.actor.colChkInfo.damageEffect == AM_DMGEFF_STUN) || diff --git a/src/overlays/actors/ovl_En_Bb/z_en_bb.c b/src/overlays/actors/ovl_En_Bb/z_en_bb.c index 3ae5e570ca..e8845f44e0 100644 --- a/src/overlays/actors/ovl_En_Bb/z_en_bb.c +++ b/src/overlays/actors/ovl_En_Bb/z_en_bb.c @@ -1150,7 +1150,7 @@ void EnBb_CollisionCheck(EnBb* this, GlobalContext* globalCtx) { if (this->collider.base.acFlags & AC_HIT) { this->collider.base.acFlags &= ~AC_HIT; this->dmgEffect = this->actor.colChkInfo.damageEffect; - Actor_SetDropFlag(&this->actor, &this->collider.elements[0].info, 0); + Actor_SetDropFlag(&this->actor, &this->collider.elements[0].info, false); switch (this->dmgEffect) { case 7: this->actor.freezeTimer = this->collider.elements[0].info.acHitInfo->toucher.damage; diff --git a/src/overlays/actors/ovl_En_Bili/z_en_bili.c b/src/overlays/actors/ovl_En_Bili/z_en_bili.c index 393b211df1..6029700499 100644 --- a/src/overlays/actors/ovl_En_Bili/z_en_bili.c +++ b/src/overlays/actors/ovl_En_Bili/z_en_bili.c @@ -549,7 +549,7 @@ void EnBili_UpdateDamage(EnBili* this, GlobalContext* globalCtx) { if ((this->actor.colChkInfo.health != 0) && (this->collider.base.acFlags & AC_HIT)) { this->collider.base.acFlags &= ~AC_HIT; - Actor_SetDropFlag(&this->actor, &this->collider.info, 1); + Actor_SetDropFlag(&this->actor, &this->collider.info, true); if ((this->actor.colChkInfo.damageEffect != 0) || (this->actor.colChkInfo.damage != 0)) { if (Actor_ApplyDamage(&this->actor) == 0) { diff --git a/src/overlays/actors/ovl_En_Bw/z_en_bw.c b/src/overlays/actors/ovl_En_Bw/z_en_bw.c index ccea5d1c1f..75fc39f40d 100644 --- a/src/overlays/actors/ovl_En_Bw/z_en_bw.c +++ b/src/overlays/actors/ovl_En_Bw/z_en_bw.c @@ -688,7 +688,7 @@ void func_809D0584(EnBw* this, GlobalContext* globalCtx) { return; } this->damageEffect = this->actor.colChkInfo.damageEffect; - Actor_SetDropFlag(&this->actor, &this->collider2.info, 0); + Actor_SetDropFlag(&this->actor, &this->collider2.info, false); if ((this->damageEffect == 1) || (this->damageEffect == 0xE)) { if (this->unk_23C == 0) { Actor_ApplyDamage(&this->actor); diff --git a/src/overlays/actors/ovl_En_Crow/z_en_crow.c b/src/overlays/actors/ovl_En_Crow/z_en_crow.c index 6512382950..29ff6e3b74 100644 --- a/src/overlays/actors/ovl_En_Crow/z_en_crow.c +++ b/src/overlays/actors/ovl_En_Crow/z_en_crow.c @@ -412,7 +412,7 @@ void EnCrow_Respawn(EnCrow* this, GlobalContext* globalCtx) { void EnCrow_UpdateDamage(EnCrow* this, GlobalContext* globalCtx) { if (this->collider.base.acFlags & AC_HIT) { this->collider.base.acFlags &= ~AC_HIT; - Actor_SetDropFlag(&this->actor, &this->collider.elements[0].info, 1); + Actor_SetDropFlag(&this->actor, &this->collider.elements[0].info, true); if ((this->actor.colChkInfo.damageEffect != 0) || (this->actor.colChkInfo.damage != 0)) { if (this->actor.colChkInfo.damageEffect == 1) { // Deku Nuts EnCrow_SetupTurnAway(this); diff --git a/src/overlays/actors/ovl_En_Dekubaba/z_en_dekubaba.c b/src/overlays/actors/ovl_En_Dekubaba/z_en_dekubaba.c index e3eda879ef..e2801c6021 100644 --- a/src/overlays/actors/ovl_En_Dekubaba/z_en_dekubaba.c +++ b/src/overlays/actors/ovl_En_Dekubaba/z_en_dekubaba.c @@ -1032,7 +1032,7 @@ void EnDekubaba_UpdateDamage(EnDekubaba* this, GlobalContext* globalCtx) { if (this->collider.base.acFlags & AC_HIT) { this->collider.base.acFlags &= ~AC_HIT; - Actor_SetDropFlagJntSph(&this->actor, &this->collider, 1); + Actor_SetDropFlagJntSph(&this->actor, &this->collider, true); if ((this->collider.base.colType != COLTYPE_HARD) && ((this->actor.colChkInfo.damageEffect != DEKUBABA_DMGEFF_NONE) || (this->actor.colChkInfo.damage != 0))) { diff --git a/src/overlays/actors/ovl_En_Dekunuts/z_en_dekunuts.c b/src/overlays/actors/ovl_En_Dekunuts/z_en_dekunuts.c index 419574dbb7..23df57679a 100644 --- a/src/overlays/actors/ovl_En_Dekunuts/z_en_dekunuts.c +++ b/src/overlays/actors/ovl_En_Dekunuts/z_en_dekunuts.c @@ -444,7 +444,7 @@ void EnDekunuts_Die(EnDekunuts* this, GlobalContext* globalCtx) { void EnDekunuts_ColliderCheck(EnDekunuts* this, GlobalContext* globalCtx) { if (this->collider.base.acFlags & AC_HIT) { this->collider.base.acFlags &= ~AC_HIT; - Actor_SetDropFlag(&this->actor, &this->collider.info, 1); + Actor_SetDropFlag(&this->actor, &this->collider.info, true); if (this->actor.colChkInfo.mass == 0x32) { if ((this->actor.colChkInfo.damageEffect != 0) || (this->actor.colChkInfo.damage != 0)) { if (this->actor.colChkInfo.damageEffect != 1) { diff --git a/src/overlays/actors/ovl_En_Dodongo/z_en_dodongo.c b/src/overlays/actors/ovl_En_Dodongo/z_en_dodongo.c index 11ebf6909c..4b03148c23 100644 --- a/src/overlays/actors/ovl_En_Dodongo/z_en_dodongo.c +++ b/src/overlays/actors/ovl_En_Dodongo/z_en_dodongo.c @@ -717,7 +717,7 @@ void EnDodongo_CollisionCheck(EnDodongo* this, GlobalContext* globalCtx) { this->colliderBody.base.acFlags &= ~AC_HIT; } else if ((this->colliderBody.base.acFlags & AC_HIT) && (this->actionState > DODONGO_DEATH)) { this->colliderBody.base.acFlags &= ~AC_HIT; - Actor_SetDropFlagJntSph(&this->actor, &this->colliderBody, 0); + Actor_SetDropFlagJntSph(&this->actor, &this->colliderBody, false); if (this->actor.colChkInfo.damageEffect != 0xE) { this->damageEffect = this->actor.colChkInfo.damageEffect; if ((this->actor.colChkInfo.damageEffect == 1) || (this->actor.colChkInfo.damageEffect == 0xF)) { diff --git a/src/overlays/actors/ovl_En_Eiyer/z_en_eiyer.c b/src/overlays/actors/ovl_En_Eiyer/z_en_eiyer.c index 2cb44f6d84..85af0043aa 100644 --- a/src/overlays/actors/ovl_En_Eiyer/z_en_eiyer.c +++ b/src/overlays/actors/ovl_En_Eiyer/z_en_eiyer.c @@ -603,7 +603,7 @@ void EnEiyer_Stunned(EnEiyer* this, GlobalContext* globalCtx) { void EnEiyer_UpdateDamage(EnEiyer* this, GlobalContext* globalCtx) { if (this->collider.base.acFlags & AC_HIT) { this->collider.base.acFlags &= ~AC_HIT; - Actor_SetDropFlag(&this->actor, &this->collider.info, 1); + Actor_SetDropFlag(&this->actor, &this->collider.info, true); if (this->actor.colChkInfo.damageEffect != 0 || this->actor.colChkInfo.damage != 0) { if (Actor_ApplyDamage(&this->actor) == 0) { diff --git a/src/overlays/actors/ovl_En_Firefly/z_en_firefly.c b/src/overlays/actors/ovl_En_Firefly/z_en_firefly.c index bff4906777..1d9c416877 100644 --- a/src/overlays/actors/ovl_En_Firefly/z_en_firefly.c +++ b/src/overlays/actors/ovl_En_Firefly/z_en_firefly.c @@ -622,7 +622,7 @@ void EnFirefly_UpdateDamage(EnFirefly* this, GlobalContext* globalCtx) { if (this->collider.base.acFlags & AC_HIT) { this->collider.base.acFlags &= ~AC_HIT; - Actor_SetDropFlag(&this->actor, &this->collider.elements[0].info, 1); + Actor_SetDropFlag(&this->actor, &this->collider.elements[0].info, true); if ((this->actor.colChkInfo.damageEffect != 0) || (this->actor.colChkInfo.damage != 0)) { if (Actor_ApplyDamage(&this->actor) == 0) { diff --git a/src/overlays/actors/ovl_En_Floormas/z_en_floormas.c b/src/overlays/actors/ovl_En_Floormas/z_en_floormas.c index c8f7dbecb3..aa195bbf57 100644 --- a/src/overlays/actors/ovl_En_Floormas/z_en_floormas.c +++ b/src/overlays/actors/ovl_En_Floormas/z_en_floormas.c @@ -979,7 +979,7 @@ void EnFloormas_ColliderCheck(EnFloormas* this, GlobalContext* globalCtx) { if ((this->collider.base.acFlags & AC_HIT) != 0) { this->collider.base.acFlags &= ~AC_HIT; - Actor_SetDropFlag(&this->actor, &this->collider.info, 1); + Actor_SetDropFlag(&this->actor, &this->collider.info, true); if ((this->actor.colChkInfo.damageEffect != 0) || (this->actor.colChkInfo.damage != 0)) { if (this->collider.base.colType != COLTYPE_HARD) { isSmall = 0; diff --git a/src/overlays/actors/ovl_En_GeldB/z_en_geldb.c b/src/overlays/actors/ovl_En_GeldB/z_en_geldb.c index 6263dc600b..fad0eebd35 100644 --- a/src/overlays/actors/ovl_En_GeldB/z_en_geldb.c +++ b/src/overlays/actors/ovl_En_GeldB/z_en_geldb.c @@ -1370,7 +1370,7 @@ void EnGeldB_CollisionCheck(EnGeldB* this, GlobalContext* globalCtx) { this->bodyCollider.base.acFlags &= ~AC_HIT; if (this->actor.colChkInfo.damageEffect != GELDB_DMG_UNK_6) { this->damageEffect = this->actor.colChkInfo.damageEffect; - Actor_SetDropFlag(&this->actor, &this->bodyCollider.info, 1); + Actor_SetDropFlag(&this->actor, &this->bodyCollider.info, true); Audio_StopSfxByPosAndId(&this->actor.projectedPos, NA_SE_EN_GERUDOFT_BREATH); if ((this->actor.colChkInfo.damageEffect == GELDB_DMG_STUN) || (this->actor.colChkInfo.damageEffect == GELDB_DMG_FREEZE)) { diff --git a/src/overlays/actors/ovl_En_Hintnuts/z_en_hintnuts.c b/src/overlays/actors/ovl_En_Hintnuts/z_en_hintnuts.c index 3ef9232fd8..af2b75fbf4 100644 --- a/src/overlays/actors/ovl_En_Hintnuts/z_en_hintnuts.c +++ b/src/overlays/actors/ovl_En_Hintnuts/z_en_hintnuts.c @@ -461,7 +461,7 @@ void EnHintnuts_Freeze(EnHintnuts* this, GlobalContext* globalCtx) { void EnHintnuts_ColliderCheck(EnHintnuts* this, GlobalContext* globalCtx) { if (this->collider.base.acFlags & AC_HIT) { this->collider.base.acFlags &= ~AC_HIT; - Actor_SetDropFlag(&this->actor, &this->collider.info, 1); + Actor_SetDropFlag(&this->actor, &this->collider.info, true); if (this->collider.base.ac->id != ACTOR_EN_NUTSBALL) { EnHintnuts_SetupBurrow(this); } else { diff --git a/src/overlays/actors/ovl_En_Ik/z_en_ik.c b/src/overlays/actors/ovl_En_Ik/z_en_ik.c index 5e7df677f0..b91c11e349 100644 --- a/src/overlays/actors/ovl_En_Ik/z_en_ik.c +++ b/src/overlays/actors/ovl_En_Ik/z_en_ik.c @@ -683,7 +683,7 @@ void func_80A75C38(EnIk* this, GlobalContext* globalCtx) { } sp38 = this->actor.world.pos; sp38.y += 50.0f; - Actor_SetDropFlag(&this->actor, &this->bodyCollider.info, 1); + Actor_SetDropFlag(&this->actor, &this->bodyCollider.info, true); temp_v0_3 = this->actor.colChkInfo.damageEffect; this->unk_2FD = temp_v0_3 & 0xFF; this->bodyCollider.base.acFlags &= ~AC_HIT; diff --git a/src/overlays/actors/ovl_En_Okuta/z_en_okuta.c b/src/overlays/actors/ovl_En_Okuta/z_en_okuta.c index 6e90bf444d..1b06a096b1 100644 --- a/src/overlays/actors/ovl_En_Okuta/z_en_okuta.c +++ b/src/overlays/actors/ovl_En_Okuta/z_en_okuta.c @@ -555,7 +555,7 @@ void EnOkuta_UpdateHeadScale(EnOkuta* this) { void EnOkuta_ColliderCheck(EnOkuta* this, GlobalContext* globalCtx) { if (this->collider.base.acFlags & AC_HIT) { this->collider.base.acFlags &= ~AC_HIT; - Actor_SetDropFlag(&this->actor, &this->collider.info, 1); + Actor_SetDropFlag(&this->actor, &this->collider.info, true); if ((this->actor.colChkInfo.damageEffect != 0) || (this->actor.colChkInfo.damage != 0)) { Enemy_StartFinishingBlow(globalCtx, &this->actor); this->actor.colChkInfo.health = 0; diff --git a/src/overlays/actors/ovl_En_Peehat/z_en_peehat.c b/src/overlays/actors/ovl_En_Peehat/z_en_peehat.c index f1c6621217..40840a85a4 100644 --- a/src/overlays/actors/ovl_En_Peehat/z_en_peehat.c +++ b/src/overlays/actors/ovl_En_Peehat/z_en_peehat.c @@ -884,7 +884,7 @@ void EnPeehat_Adult_CollisionCheck(EnPeehat* this, GlobalContext* globalCtx) { this->colJntSph.base.acFlags &= ~AC_HIT; } else if (this->colJntSph.base.acFlags & AC_HIT) { this->colJntSph.base.acFlags &= ~AC_HIT; - Actor_SetDropFlagJntSph(&this->actor, &this->colJntSph, 1); + Actor_SetDropFlagJntSph(&this->actor, &this->colJntSph, true); if (this->actor.colChkInfo.damageEffect == PEAHAT_DMG_EFF_NUT || this->actor.colChkInfo.damageEffect == PEAHAT_DMG_EFF_LIGHT_ICE_ARROW) { return; diff --git a/src/overlays/actors/ovl_En_Po_Sisters/z_en_po_sisters.c b/src/overlays/actors/ovl_En_Po_Sisters/z_en_po_sisters.c index 130b6deeef..0ad4d81c5c 100644 --- a/src/overlays/actors/ovl_En_Po_Sisters/z_en_po_sisters.c +++ b/src/overlays/actors/ovl_En_Po_Sisters/z_en_po_sisters.c @@ -1133,7 +1133,7 @@ void func_80ADC10C(EnPoSisters* this, GlobalContext* globalCtx) { if (this->collider.base.acFlags & AC_HIT) { this->collider.base.acFlags &= ~AC_HIT; - Actor_SetDropFlag(&this->actor, &this->collider.info, 1); + Actor_SetDropFlag(&this->actor, &this->collider.info, true); if (this->unk_195 != 0) { ((EnPoSisters*)this->actor.parent)->unk_19C--; Audio_PlayActorSound2(&this->actor, NA_SE_EN_PO_LAUGH2); diff --git a/src/overlays/actors/ovl_En_Rd/z_en_rd.c b/src/overlays/actors/ovl_En_Rd/z_en_rd.c index e64d597325..37ba71cd14 100644 --- a/src/overlays/actors/ovl_En_Rd/z_en_rd.c +++ b/src/overlays/actors/ovl_En_Rd/z_en_rd.c @@ -753,7 +753,7 @@ void func_80AE4114(EnRd* this, GlobalContext* globalCtx) { this->unk_31C = this->actor.colChkInfo.damageEffect; if (this->unk_31B != 11) { - Actor_SetDropFlag(&this->actor, &this->collider.info, 1); + Actor_SetDropFlag(&this->actor, &this->collider.info, true); if (player->unk_844 != 0) { this->unk_31D = player->unk_845; } diff --git a/src/overlays/actors/ovl_En_Shopnuts/z_en_shopnuts.c b/src/overlays/actors/ovl_En_Shopnuts/z_en_shopnuts.c index 36ca5ca895..973023d47f 100644 --- a/src/overlays/actors/ovl_En_Shopnuts/z_en_shopnuts.c +++ b/src/overlays/actors/ovl_En_Shopnuts/z_en_shopnuts.c @@ -228,7 +228,7 @@ void EnShopnuts_SpawnSalesman(EnShopnuts* this, GlobalContext* globalCtx) { void EnShopnuts_ColliderCheck(EnShopnuts* this, GlobalContext* globalCtx) { if (this->collider.base.acFlags & AC_HIT) { this->collider.base.acFlags &= ~AC_HIT; - Actor_SetDropFlag(&this->actor, &this->collider.info, 1); + Actor_SetDropFlag(&this->actor, &this->collider.info, true); EnShopnuts_SetupSpawnSalesman(this); } else if (globalCtx->actorCtx.unk_02 != 0) { EnShopnuts_SetupSpawnSalesman(this); diff --git a/src/overlays/actors/ovl_En_Skb/z_en_skb.c b/src/overlays/actors/ovl_En_Skb/z_en_skb.c index b5f908af7c..615f87f82d 100644 --- a/src/overlays/actors/ovl_En_Skb/z_en_skb.c +++ b/src/overlays/actors/ovl_En_Skb/z_en_skb.c @@ -449,7 +449,7 @@ void func_80AFD968(EnSkb* this, GlobalContext* globalCtx) { this->collider.base.acFlags &= ~2; if (this->actor.colChkInfo.damageEffect != 6) { this->unk_282 = this->actor.colChkInfo.damageEffect; - Actor_SetDropFlag(&this->actor, &this->collider.elements[1].info, 1); + Actor_SetDropFlag(&this->actor, &this->collider.elements[1].info, true); this->unk_281 = 0; if (this->actor.colChkInfo.damageEffect == 1) { if (this->unk_280 != 6) { diff --git a/src/overlays/actors/ovl_En_Tite/z_en_tite.c b/src/overlays/actors/ovl_En_Tite/z_en_tite.c index 326250602c..07f12e5ce7 100644 --- a/src/overlays/actors/ovl_En_Tite/z_en_tite.c +++ b/src/overlays/actors/ovl_En_Tite/z_en_tite.c @@ -852,7 +852,7 @@ void EnTite_CheckDamage(Actor* thisx, GlobalContext* globalCtx) { this->collider.base.acFlags &= ~AC_HIT; if (thisx->colChkInfo.damageEffect != 0xE) { // Immune to fire magic this->damageEffect = thisx->colChkInfo.damageEffect; - Actor_SetDropFlag(thisx, &this->collider.elements[0].info, 0); + Actor_SetDropFlag(thisx, &this->collider.elements[0].info, false); // Stun if Tektite hit by nut, boomerang, hookshot, ice arrow or ice magic if ((thisx->colChkInfo.damageEffect == 1) || (thisx->colChkInfo.damageEffect == 0xF)) { if (this->action != TEKTITE_STUNNED) { diff --git a/src/overlays/actors/ovl_En_Torch2/z_en_torch2.c b/src/overlays/actors/ovl_En_Torch2/z_en_torch2.c index c70eb25ae4..56b67679c4 100644 --- a/src/overlays/actors/ovl_En_Torch2/z_en_torch2.c +++ b/src/overlays/actors/ovl_En_Torch2/z_en_torch2.c @@ -600,7 +600,7 @@ void EnTorch2_Update(Actor* thisx, GlobalContext* globalCtx2) { this->unk_8A8 = 6.0f; this->unk_8A4 = 8.0f; this->unk_8A2 = this->actor.yawTowardsPlayer + 0x8000; - Actor_SetDropFlag(&this->actor, &this->cylinder.info, 1); + Actor_SetDropFlag(&this->actor, &this->cylinder.info, true); this->stateFlags3 &= ~PLAYER_STATE3_2; this->stateFlags3 |= PLAYER_STATE3_0; sActionState = ENTORCH2_DAMAGE; diff --git a/src/overlays/actors/ovl_En_Tp/z_en_tp.c b/src/overlays/actors/ovl_En_Tp/z_en_tp.c index 2139c13842..04b97be72c 100644 --- a/src/overlays/actors/ovl_En_Tp/z_en_tp.c +++ b/src/overlays/actors/ovl_En_Tp/z_en_tp.c @@ -578,7 +578,7 @@ void EnTp_UpdateDamage(EnTp* this, GlobalContext* globalCtx) { } this->collider.base.acFlags &= ~AC_HIT; - Actor_SetDropFlagJntSph(&this->actor, &this->collider, 1); + Actor_SetDropFlagJntSph(&this->actor, &this->collider, true); this->damageEffect = this->actor.colChkInfo.damageEffect; if (this->actor.colChkInfo.damageEffect != TAILPASARAN_DMGEFF_NONE) { diff --git a/src/overlays/actors/ovl_En_Vali/z_en_vali.c b/src/overlays/actors/ovl_En_Vali/z_en_vali.c index 4ca02b3283..3a0c4b104f 100644 --- a/src/overlays/actors/ovl_En_Vali/z_en_vali.c +++ b/src/overlays/actors/ovl_En_Vali/z_en_vali.c @@ -496,7 +496,7 @@ void EnVali_ReturnToLurk(EnVali* this, GlobalContext* globalCtx) { void EnVali_UpdateDamage(EnVali* this, GlobalContext* globalCtx) { if (this->bodyCollider.base.acFlags & AC_HIT) { this->bodyCollider.base.acFlags &= ~AC_HIT; - Actor_SetDropFlag(&this->actor, &this->bodyCollider.info, 1); + Actor_SetDropFlag(&this->actor, &this->bodyCollider.info, true); if ((this->actor.colChkInfo.damageEffect != BARI_DMGEFF_NONE) || (this->actor.colChkInfo.damage != 0)) { if (Actor_ApplyDamage(&this->actor) == 0) { diff --git a/src/overlays/actors/ovl_En_Wallmas/z_en_wallmas.c b/src/overlays/actors/ovl_En_Wallmas/z_en_wallmas.c index e3969e953d..2312d36aa3 100644 --- a/src/overlays/actors/ovl_En_Wallmas/z_en_wallmas.c +++ b/src/overlays/actors/ovl_En_Wallmas/z_en_wallmas.c @@ -503,7 +503,7 @@ void EnWallmas_Stun(EnWallmas* this, GlobalContext* globalCtx) { void EnWallmas_ColUpdate(EnWallmas* this, GlobalContext* globalCtx) { if ((this->collider.base.acFlags & AC_HIT) != 0) { this->collider.base.acFlags &= ~AC_HIT; - Actor_SetDropFlag(&this->actor, &this->collider.info, 1); + Actor_SetDropFlag(&this->actor, &this->collider.info, true); if ((this->actor.colChkInfo.damageEffect != 0) || (this->actor.colChkInfo.damage != 0)) { if (Actor_ApplyDamage(&this->actor) == 0) { Enemy_StartFinishingBlow(globalCtx, &this->actor); diff --git a/src/overlays/actors/ovl_En_Weiyer/z_en_weiyer.c b/src/overlays/actors/ovl_En_Weiyer/z_en_weiyer.c index ef303584d5..0ea7f4c185 100644 --- a/src/overlays/actors/ovl_En_Weiyer/z_en_weiyer.c +++ b/src/overlays/actors/ovl_En_Weiyer/z_en_weiyer.c @@ -562,7 +562,7 @@ void func_80B3349C(EnWeiyer* this, GlobalContext* globalCtx) { void func_80B3368C(EnWeiyer* this, GlobalContext* globalCtx) { if (this->collider.base.acFlags & AC_HIT) { this->collider.base.acFlags &= ~AC_HIT; - Actor_SetDropFlag(&this->actor, &this->collider.info, 1); + Actor_SetDropFlag(&this->actor, &this->collider.info, true); if ((this->actor.colChkInfo.damageEffect != 0) || (this->actor.colChkInfo.damage != 0)) { if (this->actor.colChkInfo.damageEffect == 1) { diff --git a/src/overlays/actors/ovl_En_Wf/z_en_wf.c b/src/overlays/actors/ovl_En_Wf/z_en_wf.c index f59b4ded0d..66f88bf256 100644 --- a/src/overlays/actors/ovl_En_Wf/z_en_wf.c +++ b/src/overlays/actors/ovl_En_Wf/z_en_wf.c @@ -1266,7 +1266,7 @@ void EnWf_UpdateDamage(EnWf* this, GlobalContext* globalCtx) { if (this->actor.colChkInfo.damageEffect != ENWF_DMGEFF_ICE_MAGIC) { this->damageEffect = this->actor.colChkInfo.damageEffect; - Actor_SetDropFlag(&this->actor, &this->colliderCylinderBody.info, 1); + Actor_SetDropFlag(&this->actor, &this->colliderCylinderBody.info, true); this->slashStatus = 0; if ((this->actor.colChkInfo.damageEffect == ENWF_DMGEFF_STUN) || diff --git a/src/overlays/actors/ovl_En_Zf/z_en_zf.c b/src/overlays/actors/ovl_En_Zf/z_en_zf.c index b8520218c3..acadf204c3 100644 --- a/src/overlays/actors/ovl_En_Zf/z_en_zf.c +++ b/src/overlays/actors/ovl_En_Zf/z_en_zf.c @@ -2002,7 +2002,7 @@ void EnZf_UpdateDamage(EnZf* this, GlobalContext* globalCtx) { (D_80B4A1B4 != this->actor.params)) && (this->actor.colChkInfo.damageEffect != ENZF_DMGEFF_IMMUNE)) { this->damageEffect = this->actor.colChkInfo.damageEffect; - Actor_SetDropFlag(&this->actor, &this->bodyCollider.info, 0); + Actor_SetDropFlag(&this->actor, &this->bodyCollider.info, false); if ((this->actor.colChkInfo.damageEffect == ENZF_DMGEFF_STUN) || (this->actor.colChkInfo.damageEffect == ENZF_DMGEFF_ICE)) { diff --git a/src/overlays/actors/ovl_player_actor/z_player.c b/src/overlays/actors/ovl_player_actor/z_player.c index 799c26a84d..e6945c8943 100644 --- a/src/overlays/actors/ovl_player_actor/z_player.c +++ b/src/overlays/actors/ovl_player_actor/z_player.c @@ -2881,34 +2881,25 @@ void func_80835F44(GlobalContext* globalCtx, Player* this, s32 item) { ((temp >= 0) && ((AMMO(sExplosiveInfos[temp].itemId) == 0) || (globalCtx->actorCtx.actorLists[ACTORCAT_EXPLOSIVE].length >= 3)))))) { func_80078884(NA_SE_SY_ERROR); - return; - } - - if (actionParam == PLAYER_AP_LENS) { + } else if (actionParam == PLAYER_AP_LENS) { if (func_80087708(globalCtx, 0, 3)) { if (globalCtx->actorCtx.lensActive) { Actor_DisableLens(globalCtx); } else { globalCtx->actorCtx.lensActive = true; } + func_80078884((globalCtx->actorCtx.lensActive) ? NA_SE_SY_GLASSMODE_ON : NA_SE_SY_GLASSMODE_OFF); } else { func_80078884(NA_SE_SY_ERROR); } - return; - } - - if (actionParam == PLAYER_AP_NUT) { + } else if (actionParam == PLAYER_AP_NUT) { if (AMMO(ITEM_NUT) != 0) { func_8083C61C(globalCtx, this); } else { func_80078884(NA_SE_SY_ERROR); } - return; - } - - temp = Player_ActionToMagicSpell(this, actionParam); - if (temp >= 0) { + } else if ((temp = Player_ActionToMagicSpell(this, actionParam)) >= 0) { if (((actionParam == PLAYER_AP_FARORES_WIND) && (gSaveContext.respawn[RESPAWN_MODE_TOP].data > 0)) || ((gSaveContext.unk_13F4 != 0) && (gSaveContext.unk_13F0 == 0) && (gSaveContext.magic >= sMagicSpellCosts[temp]))) { @@ -2917,34 +2908,27 @@ void func_80835F44(GlobalContext* globalCtx, Player* this, s32 item) { } else { func_80078884(NA_SE_SY_ERROR); } - return; - } - - if (actionParam >= PLAYER_AP_MASK_KEATON) { + } else if (actionParam >= PLAYER_AP_MASK_KEATON) { if (this->currentMask != PLAYER_MASK_NONE) { this->currentMask = PLAYER_MASK_NONE; } else { this->currentMask = actionParam - PLAYER_AP_MASK_KEATON + 1; } - func_808328EC(this, NA_SE_PL_CHANGE_ARMS); - return; - } - if (((actionParam >= PLAYER_AP_OCARINA_FAIRY) && (actionParam <= PLAYER_AP_OCARINA_TIME)) || - (actionParam >= PLAYER_AP_BOTTLE_FISH)) { + func_808328EC(this, NA_SE_PL_CHANGE_ARMS); + } else if (((actionParam >= PLAYER_AP_OCARINA_FAIRY) && (actionParam <= PLAYER_AP_OCARINA_TIME)) || + (actionParam >= PLAYER_AP_BOTTLE_FISH)) { if (!func_8008E9C4(this) || ((actionParam >= PLAYER_AP_BOTTLE_POTION_RED) && (actionParam <= PLAYER_AP_BOTTLE_FAIRY))) { TitleCard_Clear(globalCtx, &globalCtx->actorCtx.titleCtx); this->unk_6AD = 4; this->itemActionParam = actionParam; } - return; - } - - if ((actionParam != this->heldItemActionParam) || - ((this->heldActor == 0) && (Player_ActionToExplosive(this, actionParam) >= 0))) { + } else if ((actionParam != this->heldItemActionParam) || + ((this->heldActor == 0) && (Player_ActionToExplosive(this, actionParam) >= 0))) { this->nextModelGroup = Player_ActionToModelGroup(this, actionParam); nextAnimType = gPlayerModelTypes[this->nextModelGroup][PLAYER_MODELGROUPENTRY_ANIM]; + if ((this->heldItemActionParam >= 0) && (Player_ActionToMagicSpell(this, actionParam) < 0) && (item != this->heldItemId) && (D_80854164[gPlayerModelTypes[this->modelGroup][PLAYER_MODELGROUPENTRY_ANIM]][nextAnimType] != @@ -2956,10 +2940,9 @@ void func_80835F44(GlobalContext* globalCtx, Player* this, s32 item) { func_808323B4(globalCtx, this); func_80833664(globalCtx, this, actionParam); } - return; + } else { + D_80853614 = D_80853618 = true; } - - D_80853614 = D_80853618 = true; } } }