From d9dde388f552f8f43fd602df6159ccef57b2bddd Mon Sep 17 00:00:00 2001 From: Lioncash Date: Sun, 2 Aug 2020 05:34:12 -0400 Subject: [PATCH] CFireFlea: Mark helper functions as const These don't modify internal member state at all and can be marked as such. --- Runtime/MP1/World/CFireFlea.cpp | 6 +++--- Runtime/MP1/World/CFireFlea.hpp | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Runtime/MP1/World/CFireFlea.cpp b/Runtime/MP1/World/CFireFlea.cpp index 955577e1a..1654a1209 100644 --- a/Runtime/MP1/World/CFireFlea.cpp +++ b/Runtime/MP1/World/CFireFlea.cpp @@ -128,7 +128,7 @@ void CFireFlea::TargetPatrol(CStateManager& mgr, EStateMsg msg, float arg) { } } -zeus::CVector3f CFireFlea::FindSafeRoute(CStateManager& mgr, const zeus::CVector3f& forward) { +zeus::CVector3f CFireFlea::FindSafeRoute(CStateManager& mgr, const zeus::CVector3f& forward) const { const float mag = forward.magnitude(); if (mag <= 0.f) { return {}; @@ -171,11 +171,11 @@ zeus::CVector3f CFireFlea::FindSafeRoute(CStateManager& mgr, const zeus::CVector return -forward; } -bool CFireFlea::CheckNearWater(const CStateManager& mgr, const zeus::CVector3f& dir) { +bool CFireFlea::CheckNearWater(const CStateManager& mgr, const zeus::CVector3f& dir) const { rstl::reserved_vector nearList; mgr.BuildNearList(nearList, GetTranslation(), dir, 2.f, CMaterialFilter::skPassEverything, nullptr); - for (TUniqueId id : nearList) { + for (const TUniqueId id : nearList) { if (TCastToConstPtr(mgr.GetObjectById(id))) return true; } diff --git a/Runtime/MP1/World/CFireFlea.hpp b/Runtime/MP1/World/CFireFlea.hpp index ef9020ebc..f375f56f6 100644 --- a/Runtime/MP1/World/CFireFlea.hpp +++ b/Runtime/MP1/World/CFireFlea.hpp @@ -33,8 +33,8 @@ class CFireFlea : public CPatterned { CPathFindSearch xd8c_pathFind; static s32 sLightIdx; - zeus::CVector3f FindSafeRoute(CStateManager& mgr, const zeus::CVector3f& forward); - bool CheckNearWater(const CStateManager&, const zeus::CVector3f& dir); + zeus::CVector3f FindSafeRoute(CStateManager& mgr, const zeus::CVector3f& forward) const; + bool CheckNearWater(const CStateManager&, const zeus::CVector3f& dir) const; public: DEFINE_PATTERNED(FireFlea)