CFireFlea: Mark helper functions as const

These don't modify internal member state at all and can be marked as
such.
This commit is contained in:
Lioncash 2020-08-02 05:34:12 -04:00
parent 97f2576e2a
commit d9dde388f5
2 changed files with 5 additions and 5 deletions

View File

@ -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(); const float mag = forward.magnitude();
if (mag <= 0.f) { if (mag <= 0.f) {
return {}; return {};
@ -171,11 +171,11 @@ zeus::CVector3f CFireFlea::FindSafeRoute(CStateManager& mgr, const zeus::CVector
return -forward; 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<TUniqueId, 1024> nearList; rstl::reserved_vector<TUniqueId, 1024> nearList;
mgr.BuildNearList(nearList, GetTranslation(), dir, 2.f, CMaterialFilter::skPassEverything, nullptr); mgr.BuildNearList(nearList, GetTranslation(), dir, 2.f, CMaterialFilter::skPassEverything, nullptr);
for (TUniqueId id : nearList) { for (const TUniqueId id : nearList) {
if (TCastToConstPtr<CScriptWater>(mgr.GetObjectById(id))) if (TCastToConstPtr<CScriptWater>(mgr.GetObjectById(id)))
return true; return true;
} }

View File

@ -33,8 +33,8 @@ class CFireFlea : public CPatterned {
CPathFindSearch xd8c_pathFind; CPathFindSearch xd8c_pathFind;
static s32 sLightIdx; static s32 sLightIdx;
zeus::CVector3f FindSafeRoute(CStateManager& mgr, const zeus::CVector3f& forward); zeus::CVector3f FindSafeRoute(CStateManager& mgr, const zeus::CVector3f& forward) const;
bool CheckNearWater(const CStateManager&, const zeus::CVector3f& dir); bool CheckNearWater(const CStateManager&, const zeus::CVector3f& dir) const;
public: public:
DEFINE_PATTERNED(FireFlea) DEFINE_PATTERNED(FireFlea)