CElementGen: Add activeParticleCount sanity check

This commit is contained in:
Luke Street 2021-05-06 14:35:02 -04:00
parent a3628bebff
commit 5918daf818
1 changed files with 5 additions and 0 deletions

View File

@ -358,6 +358,11 @@ void CElementGen::AccumulateBounds(const zeus::CVector3f& pos, float size) {
void CElementGen::UpdateAdvanceAccessParameters(u32 activeParticleCount, s32 particleFrame) { void CElementGen::UpdateAdvanceAccessParameters(u32 activeParticleCount, s32 particleFrame) {
CGenDescription* desc = x28_loadedGenDesc; CGenDescription* desc = x28_loadedGenDesc;
if (activeParticleCount >= x60_advValues.size()) {
Log.report(logvisor::Fatal, FMT_STRING("activeParticleCount ({}) >= advValues size ({})"),
activeParticleCount, x60_advValues.size());
}
std::array<float, 8>& arr = x60_advValues[activeParticleCount]; std::array<float, 8>& arr = x60_advValues[activeParticleCount];
CParticleGlobals::instance()->m_particleAccessParameters = &arr; CParticleGlobals::instance()->m_particleAccessParameters = &arr;