From 5918daf818cf6ad1472e8d36770f88c1af0c6e2a Mon Sep 17 00:00:00 2001 From: Luke Street Date: Thu, 6 May 2021 14:35:02 -0400 Subject: [PATCH] CElementGen: Add activeParticleCount sanity check --- Runtime/Particle/CElementGen.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Runtime/Particle/CElementGen.cpp b/Runtime/Particle/CElementGen.cpp index 64a0ed9c0..beb6f1dae 100644 --- a/Runtime/Particle/CElementGen.cpp +++ b/Runtime/Particle/CElementGen.cpp @@ -358,6 +358,11 @@ void CElementGen::AccumulateBounds(const zeus::CVector3f& pos, float size) { void CElementGen::UpdateAdvanceAccessParameters(u32 activeParticleCount, s32 particleFrame) { CGenDescription* desc = x28_loadedGenDesc; + if (activeParticleCount >= x60_advValues.size()) { + Log.report(logvisor::Fatal, FMT_STRING("activeParticleCount ({}) >= advValues size ({})"), + activeParticleCount, x60_advValues.size()); + } + std::array& arr = x60_advValues[activeParticleCount]; CParticleGlobals::instance()->m_particleAccessParameters = &arr;