Skip to content

Matched StinkBugSmall at 97%#1901

Merged
ThatNintendoNerd merged 19 commits intoSMGCommunity:masterfrom
BlocksumoGuys:master
Apr 17, 2026
Merged

Matched StinkBugSmall at 97%#1901
ThatNintendoNerd merged 19 commits intoSMGCommunity:masterfrom
BlocksumoGuys:master

Conversation

@BlocksumoGuys
Copy link
Copy Markdown
Contributor

No description provided.

@decomp-dev
Copy link
Copy Markdown

decomp-dev Bot commented Apr 16, 2026

Report for RMGK01 (178771a - 00f15c5)

📈 Matched code: 47.16% (+0.03%, +1364 bytes)
📈 Matched data: 21.53% (+0.00%, +72 bytes)

✅ 10 new matches
Unit Item Bytes Before After
main/Game/Enemy/StinkBugSmall StinkBugSmall::init(const JMapInfoIter&) +560 0.00% 100.00%
main/Game/Enemy/StinkBugSmall NrvStinkBugSmall::StinkBugSmallNrvDashSignEnd::execute(Spine*) const +65 10.56% 100.00%
main/Game/Enemy/StinkBugSmall NrvStinkBugSmall::StinkBugSmallNrvShake::execute(Spine*) const +61 11.18% 100.00%
main/Game/Enemy/StinkBugSmall .sdata2 +29 61.11% 100.00%
main/Game/Enemy/StinkBugSmall NrvStinkBugSmall::StinkBugSmallNrvDPDSwoon::executeOnEnd(Spine*) const +24 0.00% 100.00%
main/Game/Enemy/StinkBugSmall StinkBugSmall::StinkBugSmall(const char*) +3 96.84% 100.00%
main/Game/Enemy/StinkBugSmall StinkBugSmall::exeWait() +1 99.85% 100.00%
main/Game/Enemy/StinkBugSmall StinkBugSmall::exeDashSign() +1 99.93% 100.00%
main/Game/Enemy/StinkBugSmall StinkBugSmall::tryDPDSwoon() +1 99.97% 100.00%
main/Game/NameObj/NameObjFactory NameObj* @unnamed@NameObjFactory_cpp@::createNameObj<StinkBugSmall>(const char*) +1 99.94% 100.00%
📈 11 improvements in unmatched items
Unit Item Bytes Before After
main/Game/Enemy/StinkBugSmall StinkBugSmall::attackSensor(HitSensor*, HitSensor*) +333 0.00% 99.17%
main/Game/Enemy/StinkBugSmall StinkBugSmall::control() +286 0.00% 70.29%
main/Game/Enemy/StinkBugSmall StinkBugSmall::initAfterPlacement() +175 0.00% 99.82%
main/Game/Enemy/StinkBugSmall StinkBugSmall::calcAndSetBaseMtx() +155 0.00% 99.49%
main/Game/Enemy/StinkBugSmall StinkBugSmall::exeBack() +43 74.15% 92.03%
main/Game/Enemy/StinkBugSmall StinkBugSmall::receiveMsgPlayerAttack(unsigned long, HitSensor*, HitSensor*) +37 87.71% 96.45%
main/Game/Enemy/StinkBugSmall StinkBugSmall::exeDash() +24 86.51% 97.96%
main/Game/Enemy/StinkBugSmall StinkBugSmall::exePanic() +13 93.93% 99.95%
main/Game/Enemy/StinkBugSmall .data +2 32.35% 32.58%
main/Game/Enemy/StinkBugSmall StinkBugSmall::exeHipDropDown() 0 99.93% 99.96%
main/Game/Enemy/StinkBugSmall StinkBugSmall::kill() 0 99.93% 99.96%

Copy link
Copy Markdown
Collaborator

@ThatNintendoNerd ThatNintendoNerd left a comment

Choose a reason for hiding this comment

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

Please cleanup unnecessary include directives in both the header and source files, as many are redundant from being included in other header files.

Comment thread src/Game/Enemy/StinkBugSmall.cpp Outdated
Comment on lines +323 to +343
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);
}
}
}
}
}
}
Copy link
Copy Markdown
Collaborator

@ThatNintendoNerd ThatNintendoNerd Apr 16, 2026

Choose a reason for hiding this comment

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

Can this function be restructured to take advantage of guard clauses instead of nested conditional statements?

Comment thread src/Game/Enemy/StinkBugSmall.cpp Outdated
TPos3f v9;
MR::calcMtxFromGravityAndZAxis(&v9, this, mGravity, _8C);
MtxPtr v2 = getBaseMtx();
MR::blendMtx(v2, v9, 0.30000001f, v9);
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This precision is not necessary so long as the literal matches without it.

Comment thread src/Game/Enemy/StinkBugSmall.cpp Outdated
Comment on lines +302 to +303
JMAVECScaleAdd(&mGravity, &mVelocity, &mVelocity, -v6);
JMAVECScaleAdd(&mGravity, &mVelocity, &mVelocity, 2.0f);
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Prefer use of mVelocity->scaleAdd instead of directly calling the corresponding JMath function.

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.

I could not use it reliably for some reasons.

Comment thread src/Game/Enemy/StinkBugSmall.cpp Outdated
Comment on lines +287 to +288
TVec3f v10(0.0f, 0.0f, 0.0f);
if (MR::isInDeath(this, v10)) {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Can this be written into the function call like MR::isInDeath(this, TVec3f(0.0f, 0.0f, 0.0f)) and still match?

Comment thread src/Game/Enemy/StinkBugSmall.cpp Outdated
Comment on lines +290 to +291
} else {
if (!tryDPDSwoon() && !tryForceFall() && !isNerve(&NrvStinkBugSmall::StinkBugSmallNrvForceFall::sInstance))
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Restructure this into an else if or make use of guard clauses. Don't forget about required curly braces for inner blocks of code.

Comment thread src/Game/Enemy/StinkBugSmall.cpp Outdated
Comment on lines +28 to +29
// all the return on void functions are used to exit the function, I have not found a way to do it otherwise.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This logic is both okay and common and does not warrant a dedicated comment.

@BlocksumoGuys
Copy link
Copy Markdown
Contributor Author

Most of the requested changes are added.

@BlocksumoGuys BlocksumoGuys changed the title Matched StinkBugSmall at 92% Matched StinkBugSmall at 93% Apr 16, 2026
Comment thread src/Game/Enemy/StinkBugSmall.cpp Outdated
}
JMAVECScaleAdd(&mGravity, &mVelocity, &mVelocity, -mGravity.dot(mVelocity));
JMAVECScaleAdd(&mGravity, &mVelocity, &mVelocity, 2.0f);
return;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

return statements at the end of functions which return void are unnecessary.

Comment thread src/Game/Enemy/StinkBugSmall.cpp Outdated
Comment on lines +308 to +309
if (!isNerve(&NrvStinkBugSmall::StinkBugSmallNrvAttack::sInstance) && isNerve(&NrvStinkBugSmall::StinkBugSmallNrvDPDSwoon::sInstance) &&
MR::isSensorPlayer(pSender) && MR::isSensorEnemyAttack(pReceiver)) {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Is it possible to use inversion here to employ another guard clause and still keep the match?

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.

It is not possible from my testing.

@BlocksumoGuys BlocksumoGuys changed the title Matched StinkBugSmall at 93% Matched StinkBugSmall at 94% Apr 16, 2026
@BlocksumoGuys
Copy link
Copy Markdown
Contributor Author

The requested changes have been added along with more matches.

@BlocksumoGuys BlocksumoGuys changed the title Matched StinkBugSmall at 94% Matched StinkBugSmall at 97% Apr 17, 2026
@BlocksumoGuys
Copy link
Copy Markdown
Contributor Author

Last of my changes were added, no further last minute changes will be added unless requested.

@ThatNintendoNerd ThatNintendoNerd merged commit 9ee9ca1 into SMGCommunity:master Apr 17, 2026
1 check passed
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.

2 participants