mirror of
https://github.com/AxioDL/metaforce.git
synced 2025-07-14 02:45:52 +00:00
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,12 +1103,13 @@ bool CBabygoth::Leash(CStateManager& mgr, float) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CBabygoth::IsDestinationObstructed(CStateManager& mgr) {
|
bool CBabygoth::IsDestinationObstructed(const CStateManager& mgr) const {
|
||||||
for (CEntity* obj : mgr.GetListeningAiObjectList()) {
|
for (const CEntity* obj : mgr.GetListeningAiObjectList()) {
|
||||||
if (TCastToPtr<CAi> ai = obj) {
|
if (const TCastToConstPtr<CAi> ai = obj) {
|
||||||
if (ai->GetAreaIdAlways() == GetAreaIdAlways()) {
|
if (ai->GetAreaIdAlways() == GetAreaIdAlways()) {
|
||||||
if ((x8b8_backupDestPos - ai->GetTranslation()).magSquared() <= 10.f)
|
if ((x8b8_backupDestPos - ai->GetTranslation()).magSquared() <= 10.f) {
|
||||||
return true;
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -160,7 +160,7 @@ private:
|
|||||||
|
|
||||||
void UpdateShellHealth(CStateManager&);
|
void UpdateShellHealth(CStateManager&);
|
||||||
|
|
||||||
bool IsDestinationObstructed(CStateManager&);
|
bool IsDestinationObstructed(const CStateManager& mgr) const;
|
||||||
|
|
||||||
void DestroyShell(CStateManager& mgr);
|
void DestroyShell(CStateManager& mgr);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user