MarioSwim 97%#1858
Conversation
Report for RMGK01 (e5a64e4 - 734bdd0)📈 Matched code: 40.12% (+0.20%, +10992 bytes) ✅ 5 new matches
📈 12 improvements in unmatched functions
|
| #include "Game/Util/SceneUtil.hpp" | ||
| #include "JSystem/JGeometry/TVec.hpp" | ||
| #include "math_types.hpp" | ||
| #include "revolution/types.h" | ||
| #include <cstddef> | ||
|
|
||
| const f32 cAnimSpeeds[4] = {1.0f, 1.0f, 1.0f, 1.0f}; |
There was a problem hiding this comment.
Remove the explicit array size for portability.
| if (mJetTimer != 0) | ||
| return; |
There was a problem hiding this comment.
Always include curly braces for conditional blocks, even if the underlying code is only one statement.
| MR::getWaterAreaObj(&headWaterInfo, checkPos); | ||
| if (!bodyWaterInfo.isInWater() || !headWaterInfo.isInWater()) { | ||
| return false; | ||
| if (!MR::isNearZero(_184, 0.001f)) { |
There was a problem hiding this comment.
Remove the tolerance argument in favor of the equivalent default parameter.
| } else { | ||
| mNextAction = EXIT_ACTION_JUMP; | ||
| } | ||
| if (!MR::isNearZero(_184, 0.001f)) { |
There was a problem hiding this comment.
Remove the tolerance argument in favor of the equivalent default parameter.
| AreaInfo* MarioSwim::getWaterAreaInfo(WaterInfo* pInfo, const TVec3f& rPos, TVec2f* pOutVec) { | ||
| AreaInfo* waterAreaInfo = MR::getWaterAreaInfo(pInfo, rPos, getPlayer()->getAirGravityVec(), false); | ||
|
|
||
| if (pOutVec) { |
There was a problem hiding this comment.
Prefer an explicit comparison to nullptr for pointer null checking.
| if (mIsOnSurface != 0) { | ||
| _36 = 20; | ||
| _30 = 50; | ||
| _7C = 45; | ||
| _2C = 30; | ||
| } else { | ||
| _36 = mActor->getConst().getTable()->mSwimSpinFrontTime; | ||
| _30 = mActor->getConst().getTable()->mSwimSpinYspeedTime; | ||
| } | ||
|
|
||
| if (mIsOnSurface == 0) { |
There was a problem hiding this comment.
Prefer an implicit comparison to true/false for Boolean variables.
| MR::vecKillElement(velocityPart, getGravityVec(), &direction); | ||
|
|
||
| direction.length(); | ||
| if (MR::normalizeOrZero(&direction) == 0) { |
There was a problem hiding this comment.
Prefer an implicit comparison to true/false for Boolean return values.
| } | ||
|
|
||
| // Wall Push / Kick Logic check | ||
| if (rNormal.dot(getGravityVec()) > 0.80000001f) { |
There was a problem hiding this comment.
I don't think this precision is necessary. 0.8f should suffice.
|
I pushed the requested fixes |
No description provided.