2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-12-15 07:26:10 +00:00

CIceSheegoth: Add missing reference ampersands to IsClosestSheegoth()

Same behavior, but doesn't make copies of the vector and
reserved_vector (the reserved vector in particular is 2056 bytes in size
and this function is called in a loop, so this can have quite an
impact).
This commit is contained in:
Lioncash
2020-06-11 10:27:58 -04:00
parent 5f899b6c6c
commit 17ed0794e9
2 changed files with 5 additions and 6 deletions

View File

@@ -1493,12 +1493,11 @@ bool CIceSheegoth::ShouldAttractProjectile(const CGameProjectile& proj, CStateMa
return false;
}
bool CIceSheegoth::IsClosestSheegoth(CStateManager& mgr, rstl::reserved_vector<TUniqueId, 1024> nearList,
zeus::CVector3f projectileOffset) const {
bool CIceSheegoth::IsClosestSheegoth(CStateManager& mgr, const rstl::reserved_vector<TUniqueId, 1024>& nearList,
const zeus::CVector3f& projectileOffset) const {
zeus::CVector3f diff = projectileOffset - GetTranslation();
const float diffMag = diff.magSquared();
for (TUniqueId uid : nearList) {
for (const TUniqueId uid : nearList) {
const CIceSheegoth* goth = CPatterned::CastTo<CIceSheegoth>(mgr.GetObjectById(uid));
if (!goth || goth->GetUniqueId() == GetUniqueId())
continue;