1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-07-02 22:14:33 +00:00

Fix misc 11 (#1209)

* Pass boolean for `freezeFlag` to `Actor_SetDropFlag`

* Use `else if`s in `func_80835F44`

* Cleanup `transitionCtx` usage of instance data

* `TransitionContext.setEnvColor` -> `TransitionContext.setUnkColor`

* Fixup one comment

* linebreaks (#1)

* Run formatter

Co-authored-by: fig02 <fig02srl@gmail.com>
This commit is contained in:
Dragorn421 2022-05-04 21:25:26 +02:00 committed by GitHub
parent 765cfd63e9
commit ca77b26c90
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
35 changed files with 79 additions and 93 deletions

View file

@ -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) ||

View file

@ -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;

View file

@ -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) {

View file

@ -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);

View file

@ -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);

View file

@ -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))) {

View file

@ -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) {

View file

@ -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)) {

View file

@ -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) {

View file

@ -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) {

View file

@ -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;

View file

@ -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)) {

View file

@ -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 {

View file

@ -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;

View file

@ -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;

View file

@ -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;

View file

@ -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);

View file

@ -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;
}

View file

@ -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);

View file

@ -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) {

View file

@ -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) {

View file

@ -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;

View file

@ -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) {

View file

@ -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) {

View file

@ -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);

View file

@ -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) {

View file

@ -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) ||

View file

@ -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)) {

View file

@ -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;
}
}
}