2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-07-01 03:33:28 +00:00

CPlayer: Make nearby variables const

Makes nearby variables from the previous change const to make their
immutability explicit.
This commit is contained in:
Lioncash 2020-03-06 22:08:54 -05:00
parent a2b6b4515d
commit 830e1c59d2

View File

@ -1688,16 +1688,16 @@ void CPlayer::ProcessInput(const CFinalInput& input, CStateManager& mgr) {
if (x2f8_morphBallState == EPlayerMorphBallState::Unmorphed && x4a0_failsafeTest->Passes()) { if (x2f8_morphBallState == EPlayerMorphBallState::Unmorphed && x4a0_failsafeTest->Passes()) {
auto* prim = static_cast<const CCollidableAABox*>(GetCollisionPrimitive()); auto* prim = static_cast<const CCollidableAABox*>(GetCollisionPrimitive());
zeus::CAABox tmpAABB(prim->GetBox().min - 0.2f, prim->GetBox().max + 0.2f); const zeus::CAABox tmpAABB(prim->GetBox().min - 0.2f, prim->GetBox().max + 0.2f);
CCollidableAABox tmpBox(tmpAABB, prim->GetMaterial()); const CCollidableAABox tmpBox(tmpAABB, prim->GetMaterial());
CPhysicsActor::Stop(); CPhysicsActor::Stop();
zeus::CAABox testBounds = prim->GetBox().getTransformedAABox(x34_transform); const zeus::CAABox testBounds = prim->GetBox().getTransformedAABox(x34_transform);
zeus::CAABox expandedBounds(testBounds.min - 3.f, testBounds.max + 3.f); const zeus::CAABox expandedBounds(testBounds.min - 3.f, testBounds.max + 3.f);
CAreaCollisionCache cache(expandedBounds); CAreaCollisionCache cache(expandedBounds);
CGameCollision::BuildAreaCollisionCache(mgr, cache); CGameCollision::BuildAreaCollisionCache(mgr, cache);
rstl::reserved_vector<TUniqueId, 1024> nearList; rstl::reserved_vector<TUniqueId, 1024> nearList;
mgr.BuildColliderList(nearList, *this, expandedBounds); mgr.BuildColliderList(nearList, *this, expandedBounds);
std::optional<zeus::CVector3f> nonIntVec = const std::optional<zeus::CVector3f> nonIntVec =
CGameCollision::FindNonIntersectingVector(mgr, cache, *this, tmpBox, nearList); CGameCollision::FindNonIntersectingVector(mgr, cache, *this, tmpBox, nearList);
if (nonIntVec) { if (nonIntVec) {
x4a0_failsafeTest->Reset(); x4a0_failsafeTest->Reset();