Add safety checks for particles data to prevent division by 0

This commit is contained in:
Wojtek Figat
2021-02-06 15:58:12 +01:00
parent d27edbf5a9
commit 25f35b22be
3 changed files with 23 additions and 23 deletions

View File

@@ -284,7 +284,7 @@ void ParticleEmitterGraphCPUExecutor::ProcessGroupParticles(Box* box, Node* node
{
const float age = GET_PARTICLE_ATTRIBUTE(0, float);
const float lifetime = GET_PARTICLE_ATTRIBUTE(1, float);
value = age / lifetime;
value = age / Math::Max(lifetime, ZeroTolerance);
break;
}
// Effect Position