Skip to content

d_a_e_ym (a.k.a. Twilight bugs) 99% equivalent (daE_YM_c::checkBeforeBg and daE_YM_c::create have regalloc issues)#2311

Merged
TakaRikka merged 8 commits intozeldaret:mainfrom
YunataSavior:dev_d_a_e_ym
Mar 1, 2025
Merged

d_a_e_ym (a.k.a. Twilight bugs) 99% equivalent (daE_YM_c::checkBeforeBg and daE_YM_c::create have regalloc issues)#2311
TakaRikka merged 8 commits intozeldaret:mainfrom
YunataSavior:dev_d_a_e_ym

Conversation

@YunataSavior
Copy link
Copy Markdown
Contributor

No description provided.

@YunataSavior YunataSavior changed the title d_a_e_ym (a.k.a. Twilight bugs) WIP d_a_e_ym (a.k.a. Twilight bugs) 99% equivalent (daE_YM_c::checkBeforeBg and daE_YM_c::create have regalloc issues) Feb 28, 2025
@YunataSavior YunataSavior marked this pull request as ready for review February 28, 2025 07:42
Comment on lines +450 to +507
if (mAcch.ChkGroundHit() == 0) {
return 0;
}
f32 my_val;
if (mType == 4) {
my_val = l_HIO.mSurpriseDistance + 200.0f;
} else {
if (field_0x6a9 != 0) {
my_val = l_HIO.mSurpriseDistance;
} else {
my_val = l_HIO.mSurpriseDistance + 200.0f;
}
}
if (mDistToPlayer < my_val) {
if (mSphCc.ChkCoHit()) {
cCcD_Obj* hit_obj = mSphCc.GetCoHitObj();
fopAc_ac_c* my_ac = dCc_GetAc(hit_obj->GetAc());
if (fopAcM_GetName(my_ac) == PROC_ALINK) {
if (mType == 4) {
return checkRailSurprise();
}
if (mTagPosP != NULL) {
setActionMode(ACT_FLY);
} else {
setActionMode(ACT_SURPRISE);
}
return 1;
}
}
if (mAction == ACT_ATTACK) {
return 0;
}
if (player->getSpeedF() >= 16.0f) {
field_0x6f6 = 0;
} else {
if (field_0x6f8) {
return 0;
}
if (mDistToPlayer > l_HIO.mSurpriseDistance - 100.0f) {
field_0x6f8 = 0x3c;
return 0;
}
}
if (field_0x6f6 == 0) {
if (mType == 4) {
return checkRailSurprise();
}
if (mTagPosP != NULL) {
setActionMode(ACT_FLY);
} else {
setActionMode(ACT_SURPRISE);
}
return 1;
}
} else {
field_0x6f8 = 0;
}
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is a minor style thing but i prefer separating unrelated if statement blocks with an empty line to increase readability.

if () {

} else {

}
// empty line
if () {
// . . .

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To me, I don't agree. Keeping code compact is more important. I only ever put empty lines to space out functional blocks.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

im not gonna enforce it for now since just getting files done is more important, but later down the line on future cleanup passes i will enforce it or fix it myself since compact is really unreadable imo. makes understanding whats going on much more difficult

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alright. In future TUs, I will adopt this coding standard

@TakaRikka TakaRikka merged commit 9c3c075 into zeldaret:main Mar 1, 2025
1 check passed
@YunataSavior YunataSavior deleted the dev_d_a_e_ym branch March 2, 2025 06:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants