diff options
author | Bojidar Marinov <bojidar.marinov.bg@gmail.com> | 2017-08-16 23:38:36 +0300 |
---|---|---|
committer | Bojidar Marinov <bojidar.marinov.bg@gmail.com> | 2017-08-16 23:38:36 +0300 |
commit | 995fca44b200b093f1d3ff62d16846ba2e3df900 (patch) | |
tree | 9b8e8ba3e322b94bbbda92f3fd419613e672d114 | |
parent | 19aff15a1af27a428c82f4a30dea498be9319de1 (diff) |
Fix particles emitting when emitting is set to false in scene
Caused by #10297 calling particles_restart() on the same frame as the one set_emitting(false) is called. The rasterizer would wait a frame, and then set emitting back to true.
-rw-r--r-- | drivers/gles3/rasterizer_storage_gles3.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/gles3/rasterizer_storage_gles3.cpp b/drivers/gles3/rasterizer_storage_gles3.cpp index ea6ac569f0..24fa117051 100644 --- a/drivers/gles3/rasterizer_storage_gles3.cpp +++ b/drivers/gles3/rasterizer_storage_gles3.cpp @@ -5177,6 +5177,10 @@ void RasterizerStorageGLES3::particles_set_emitting(RID p_particles, bool p_emit Particles *particles = particles_owner.getornull(p_particles); ERR_FAIL_COND(!particles); + if (p_emitting != particles->emitting) { + // Restart is overriden by set_emitting + particles->restart_request = false; + } particles->emitting = p_emitting; } void RasterizerStorageGLES3::particles_set_amount(RID p_particles, int p_amount) { |