mirror of https://github.com/AxioDL/metaforce.git
CBabygoth: Mark IsDestinationObstructed() as const
This doesn't alter class state, so we can mark it as const.
This commit is contained in:
parent
abd576a43a
commit
bfea80fc4a
|
@ -1103,15 +1103,16 @@ bool CBabygoth::Leash(CStateManager& mgr, float) {
|
|||
return false;
|
||||
}
|
||||
|
||||
bool CBabygoth::IsDestinationObstructed(CStateManager& mgr) {
|
||||
for (CEntity* obj : mgr.GetListeningAiObjectList()) {
|
||||
if (TCastToPtr<CAi> ai = obj) {
|
||||
bool CBabygoth::IsDestinationObstructed(const CStateManager& mgr) const {
|
||||
for (const CEntity* obj : mgr.GetListeningAiObjectList()) {
|
||||
if (const TCastToConstPtr<CAi> ai = obj) {
|
||||
if (ai->GetAreaIdAlways() == GetAreaIdAlways()) {
|
||||
if ((x8b8_backupDestPos - ai->GetTranslation()).magSquared() <= 10.f)
|
||||
if ((x8b8_backupDestPos - ai->GetTranslation()).magSquared() <= 10.f) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -160,7 +160,7 @@ private:
|
|||
|
||||
void UpdateShellHealth(CStateManager&);
|
||||
|
||||
bool IsDestinationObstructed(CStateManager&);
|
||||
bool IsDestinationObstructed(const CStateManager& mgr) const;
|
||||
|
||||
void DestroyShell(CStateManager& mgr);
|
||||
|
||||
|
|
Loading…
Reference in New Issue