mirror of https://github.com/AxioDL/metaforce.git
CTeamAiMgr: Make reference parameters to GetTeamAiMgr() const
No modifications to these parameters are being made, so we can make that explicit in the interface.
This commit is contained in:
parent
21a33b01ad
commit
d0233b7767
|
@ -361,14 +361,15 @@ bool CTeamAiMgr::AddAttacker(EAttackType type, CStateManager& mgr, TUniqueId mgr
|
|||
return false;
|
||||
}
|
||||
|
||||
TUniqueId CTeamAiMgr::GetTeamAiMgr(CAi& ai, CStateManager& mgr) {
|
||||
TUniqueId CTeamAiMgr::GetTeamAiMgr(const CAi& ai, const CStateManager& mgr) {
|
||||
for (const auto& conn : ai.GetConnectionList()) {
|
||||
if (conn.x0_state == EScriptObjectState::Active && conn.x4_msg == EScriptObjectMessage::Play) {
|
||||
TUniqueId id = mgr.GetIdForScript(conn.x8_objId);
|
||||
if (TCastToConstPtr<CTeamAiMgr> aimgr = mgr.GetObjectById(id))
|
||||
const TUniqueId id = mgr.GetIdForScript(conn.x8_objId);
|
||||
if (const TCastToConstPtr<CTeamAiMgr> aimgr = mgr.GetObjectById(id)) {
|
||||
return aimgr->GetUniqueId();
|
||||
}
|
||||
}
|
||||
}
|
||||
return kInvalidUniqueId;
|
||||
}
|
||||
|
||||
|
|
|
@ -114,6 +114,6 @@ public:
|
|||
static bool CanAcceptAttacker(EAttackType type, CStateManager& mgr, TUniqueId mgrId, TUniqueId aiId);
|
||||
static bool AddAttacker(EAttackType type, CStateManager& mgr, TUniqueId mgrId, TUniqueId aiId);
|
||||
|
||||
static TUniqueId GetTeamAiMgr(CAi& ai, CStateManager& mgr);
|
||||
static TUniqueId GetTeamAiMgr(const CAi& ai, const CStateManager& mgr);
|
||||
};
|
||||
} // namespace urde
|
||||
|
|
Loading…
Reference in New Issue