Fix T75987: crash entering edit mode with keyed particles

This commit is contained in:
Brecht Van Lommel 2020-04-23 14:51:07 +02:00
parent a0652430d0
commit 5afba30c69
Notes: blender-bot 2023-02-14 10:48:33 +01:00
Referenced by issue #75987, Editing Object when keyed particles - Crash
1 changed files with 2 additions and 1 deletions

View File

@ -1258,7 +1258,8 @@ static void set_keyed_keys(ParticleSimulationData *sim)
key = pa->keys + k;
key->time = -1.0; /* use current time */
psys_get_particle_state(&ksim, p % ksim.psys->totpart, key, 1);
const int p_ksim = (ksim.psys->totpart) ? p % ksim.psys->totpart : 0;
psys_get_particle_state(&ksim, p_ksim, key, 1);
if (psys->flag & PSYS_KEYED_TIMING) {
key->time = pa->time + pt->time;