summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2018-10-08 00:55:15 -0300
committerJuan Linietsky <reduzio@gmail.com>2018-10-08 00:55:43 -0300
commit328679fddd426040a9af4891e937cbadb03371dd (patch)
treece8eebf4d4717532255d4ae44cdc3a9c6eb2018d
parent14494dddd04bb9b6964940cdde97fe0364299b96 (diff)
Ensure CPU particles do not process if not visible
-rw-r--r--scene/2d/cpu_particles_2d.cpp2
-rw-r--r--scene/3d/cpu_particles.cpp2
2 files changed, 2 insertions, 2 deletions
diff --git a/scene/2d/cpu_particles_2d.cpp b/scene/2d/cpu_particles_2d.cpp
index d29c6b37d5..e6dcd643be 100644
--- a/scene/2d/cpu_particles_2d.cpp
+++ b/scene/2d/cpu_particles_2d.cpp
@@ -985,7 +985,7 @@ void CPUParticles2D::_notification(int p_what) {
if (p_what == NOTIFICATION_INTERNAL_PROCESS) {
- if (particles.size() == 0)
+ if (particles.size() == 0 || !is_visible_in_tree())
return;
float delta = get_process_delta_time();
diff --git a/scene/3d/cpu_particles.cpp b/scene/3d/cpu_particles.cpp
index b396397c6d..35a2049bda 100644
--- a/scene/3d/cpu_particles.cpp
+++ b/scene/3d/cpu_particles.cpp
@@ -1036,7 +1036,7 @@ void CPUParticles::_notification(int p_what) {
if (p_what == NOTIFICATION_INTERNAL_PROCESS) {
- if (particles.size() == 0)
+ if (particles.size() == 0 || !is_visible_in_tree())
return;
float delta = get_process_delta_time();