Particle System: Pass correct particle index when drawing
authorSybren A. Stüvel <sybren@stuvel.eu>
Wed, 16 May 2018 14:09:27 +0000 (16:09 +0200)
committerSybren A. Stüvel <sybren@stuvel.eu>
Wed, 16 May 2018 14:09:52 +0000 (16:09 +0200)
Passing the wrong index caused the particles to stop being shown when the
first particle dies.

source/blender/draw/intern/draw_cache_impl_particles.c

index a1eb98a85e21657a0b7fbfbb481f2c5d1f12b611..b8b24ac8afcf0261ad9abdee575234ace6c77b03 100644 (file)
@@ -584,7 +584,7 @@ static void particle_batch_cache_ensure_pos(Object *object,
 
        for (curr_point = 0, i = 0, pa = psys->particles; i < psys->totpart; i++, pa++) {
                state.time = DEG_get_ctime(draw_ctx->depsgraph);
-               if (!psys_get_particle_state(&sim, curr_point, &state, 0)) {
+               if (!psys_get_particle_state(&sim, i, &state, 0)) {
                        continue;
                }