CBabygoth: Mark IsDestinationObstructed() as const

This doesn't alter class state, so we can mark it as const.
This commit is contained in:
Lioncash 2020-04-12 11:05:54 -04:00
parent abd576a43a
commit bfea80fc4a
2 changed files with 6 additions and 5 deletions

View File

@ -1103,12 +1103,13 @@ 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;
}
}
}
}

View File

@ -160,7 +160,7 @@ private:
void UpdateShellHealth(CStateManager&);
bool IsDestinationObstructed(CStateManager&);
bool IsDestinationObstructed(const CStateManager& mgr) const;
void DestroyShell(CStateManager& mgr);