Matched StinkBugSmall at 97%#1901
Conversation
Report for RMGK01 (178771a - 00f15c5)📈 Matched code: 47.16% (+0.03%, +1364 bytes) ✅ 10 new matches
📈 11 improvements in unmatched items
|
ThatNintendoNerd
left a comment
There was a problem hiding this comment.
Please cleanup unnecessary include directives in both the header and source files, as many are redundant from being included in other header files.
| if (!isNerve(&NrvStinkBugSmall::StinkBugSmallNrvHipDropDown::sInstance)) { | ||
| if (_C4 && getSensor("body")) { | ||
| return; | ||
| } | ||
| if (!isNerve(&NrvStinkBugSmall::StinkBugSmallNrvAttack::sInstance) && isNerve(&NrvStinkBugSmall::StinkBugSmallNrvDPDSwoon::sInstance) && | ||
| MR::isSensorPlayer(pSender) && MR::isSensorEnemyAttack(pReceiver)) { | ||
| if (MR::isPlayerDamaging()) { | ||
| MR::sendMsgPush(pReceiver, pSender); | ||
| return; | ||
| } | ||
| if (isHitHorn(pSender, pReceiver, mScale.x * 20.0f)) { | ||
| if (MR::sendMsgEnemyAttackStrong(pReceiver, pSender)) { | ||
| MR::emitEffectHitBetweenSensors(this, pSender, pReceiver, 0.0f, nullptr); | ||
| if (isNerve(&NrvStinkBugSmall::StinkBugSmallNrvDash::sInstance)) { | ||
| setNerve(&NrvStinkBugSmall::StinkBugSmallNrvAttack::sInstance); | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } |
There was a problem hiding this comment.
Can this function be restructured to take advantage of guard clauses instead of nested conditional statements?
| TPos3f v9; | ||
| MR::calcMtxFromGravityAndZAxis(&v9, this, mGravity, _8C); | ||
| MtxPtr v2 = getBaseMtx(); | ||
| MR::blendMtx(v2, v9, 0.30000001f, v9); |
There was a problem hiding this comment.
This precision is not necessary so long as the literal matches without it.
| JMAVECScaleAdd(&mGravity, &mVelocity, &mVelocity, -v6); | ||
| JMAVECScaleAdd(&mGravity, &mVelocity, &mVelocity, 2.0f); |
There was a problem hiding this comment.
Prefer use of mVelocity->scaleAdd instead of directly calling the corresponding JMath function.
There was a problem hiding this comment.
I could not use it reliably for some reasons.
| TVec3f v10(0.0f, 0.0f, 0.0f); | ||
| if (MR::isInDeath(this, v10)) { |
There was a problem hiding this comment.
Can this be written into the function call like MR::isInDeath(this, TVec3f(0.0f, 0.0f, 0.0f)) and still match?
| } else { | ||
| if (!tryDPDSwoon() && !tryForceFall() && !isNerve(&NrvStinkBugSmall::StinkBugSmallNrvForceFall::sInstance)) |
There was a problem hiding this comment.
Restructure this into an else if or make use of guard clauses. Don't forget about required curly braces for inner blocks of code.
| // all the return on void functions are used to exit the function, I have not found a way to do it otherwise. | ||
|
|
There was a problem hiding this comment.
This logic is both okay and common and does not warrant a dedicated comment.
|
Most of the requested changes are added. |
| } | ||
| JMAVECScaleAdd(&mGravity, &mVelocity, &mVelocity, -mGravity.dot(mVelocity)); | ||
| JMAVECScaleAdd(&mGravity, &mVelocity, &mVelocity, 2.0f); | ||
| return; |
There was a problem hiding this comment.
return statements at the end of functions which return void are unnecessary.
| if (!isNerve(&NrvStinkBugSmall::StinkBugSmallNrvAttack::sInstance) && isNerve(&NrvStinkBugSmall::StinkBugSmallNrvDPDSwoon::sInstance) && | ||
| MR::isSensorPlayer(pSender) && MR::isSensorEnemyAttack(pReceiver)) { |
There was a problem hiding this comment.
Is it possible to use inversion here to employ another guard clause and still keep the match?
There was a problem hiding this comment.
It is not possible from my testing.
|
The requested changes have been added along with more matches. |
|
Last of my changes were added, no further last minute changes will be added unless requested. |
No description provided.