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 Mar 1, 2025
Conversation
…c issues. Cleanup of mSound funcs in d_a_e_ym.
TakaRikka
reviewed
Feb 28, 2025
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; | ||
| } | ||
| } |
Contributor
There was a problem hiding this comment.
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 () {
// . . .
Contributor
Author
There was a problem hiding this comment.
To me, I don't agree. Keeping code compact is more important. I only ever put empty lines to space out functional blocks.
Contributor
There was a problem hiding this comment.
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
Contributor
Author
There was a problem hiding this comment.
Alright. In future TUs, I will adopt this coding standard
TakaRikka
approved these changes
Mar 1, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.