summaryrefslogtreecommitdiff
path: root/scene/3d
diff options
context:
space:
mode:
authorJFonS <joan.fonssanchez@gmail.com>2019-03-10 00:33:08 +0100
committerJFonS <joan.fonssanchez@gmail.com>2019-03-10 00:33:08 +0100
commitc13ac398f68ac1c16967ea2ffdfaf7cc854f76a8 (patch)
tree68b3b42184e40aa298e6cc4fcba4c4ebcf40b827 /scene/3d
parent362b42787b8c48da61b3cb7cd2de718d259d723f (diff)
Fix resetting of CPUParticles (2D and 3D)
Diffstat (limited to 'scene/3d')
-rw-r--r--scene/3d/cpu_particles.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/scene/3d/cpu_particles.cpp b/scene/3d/cpu_particles.cpp
index fc2e5c9b0d..85bc2dd529 100644
--- a/scene/3d/cpu_particles.cpp
+++ b/scene/3d/cpu_particles.cpp
@@ -544,7 +544,7 @@ void CPUParticles::_particles_process(float p_delta) {
if (restart_time >= prev_time && restart_time < time) {
restart = true;
if (fractional_delta) {
- local_delta = (time - restart_time) * lifetime;
+ local_delta = time - restart_time;
}
}
@@ -552,13 +552,13 @@ void CPUParticles::_particles_process(float p_delta) {
if (restart_time >= prev_time) {
restart = true;
if (fractional_delta) {
- local_delta = (1.0 - restart_time + time) * lifetime;
+ local_delta = lifetime - restart_time + time;
}
} else if (restart_time < time) {
restart = true;
if (fractional_delta) {
- local_delta = (time - restart_time) * lifetime;
+ local_delta = time - restart_time;
}
}
}