2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-12-21 17:39:13 +00:00

De-hardcode max entity count

This commit is contained in:
2021-06-06 16:53:41 -07:00
parent 89378700f7
commit 5f1aed51cb
64 changed files with 246 additions and 238 deletions

View File

@@ -1146,7 +1146,7 @@ void CIceSheegoth::AttractProjectiles(CStateManager& mgr) {
if (!IsAlive())
return;
rstl::reserved_vector<TUniqueId, 1024> nearProjectiles;
rstl::reserved_vector<TUniqueId, kMaxEntities> nearProjectiles;
zeus::CAABox attractionBounds =
zeus::CAABox{GetTranslation() - x56c_sheegothData.Get_x14(), GetTranslation() + x56c_sheegothData.Get_x14()};
mgr.BuildNearList(nearProjectiles, attractionBounds, CMaterialFilter::MakeInclude({EMaterialTypes::Projectile}),
@@ -1156,7 +1156,7 @@ void CIceSheegoth::AttractProjectiles(CStateManager& mgr) {
return;
zeus::CVector3f attractionPos = GetEnergyAttractionPos(mgr);
rstl::reserved_vector<TUniqueId, 1024> nearCharacters;
rstl::reserved_vector<TUniqueId, kMaxEntities> nearCharacters;
mgr.BuildNearList(nearCharacters, attractionBounds, CMaterialFilter::MakeInclude({EMaterialTypes::Character}),
nullptr);
@@ -1494,7 +1494,7 @@ bool CIceSheegoth::ShouldAttractProjectile(const CGameProjectile& proj, CStateMa
return false;
}
bool CIceSheegoth::IsClosestSheegoth(CStateManager& mgr, const rstl::reserved_vector<TUniqueId, 1024>& nearList,
bool CIceSheegoth::IsClosestSheegoth(CStateManager& mgr, const rstl::reserved_vector<TUniqueId, kMaxEntities>& nearList,
const zeus::CVector3f& projectileOffset) const {
zeus::CVector3f diff = projectileOffset - GetTranslation();
const float diffMag = diff.magSquared();