summaryrefslogtreecommitdiff
path: root/scene
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2019-10-25 07:24:36 +0200
committerGitHub <noreply@github.com>2019-10-25 07:24:36 +0200
commit66ccdebbb3b504688915bc4d1e37d580b65f5797 (patch)
tree07a09a601516284248eff20e263e2076b746be01 /scene
parentb1e4a62ee090387ee26991d87cd61bed9a39820b (diff)
parent1e0f37a70fd90e0ee8c7f43697bdc866cf8120b6 (diff)
Merge pull request #33045 from nekomatata/cpu-particle-uninitialized-member
Fixed emitting not initialized correctly in cpu particles 2d/3d
Diffstat (limited to 'scene')
-rw-r--r--scene/2d/cpu_particles_2d.cpp6
-rw-r--r--scene/3d/cpu_particles.cpp6
2 files changed, 8 insertions, 4 deletions
diff --git a/scene/2d/cpu_particles_2d.cpp b/scene/2d/cpu_particles_2d.cpp
index 9da41914d7..07f3e10244 100644
--- a/scene/2d/cpu_particles_2d.cpp
+++ b/scene/2d/cpu_particles_2d.cpp
@@ -260,8 +260,7 @@ void CPUParticles2D::restart() {
inactive_time = 0;
frame_remainder = 0;
cycle = 0;
-
- set_emitting(true);
+ emitting = false;
{
int pc = particles.size();
@@ -271,6 +270,8 @@ void CPUParticles2D::restart() {
w[i].active = false;
}
}
+
+ set_emitting(true);
}
void CPUParticles2D::set_direction(Vector2 p_direction) {
@@ -1422,6 +1423,7 @@ CPUParticles2D::CPUParticles2D() {
frame_remainder = 0;
cycle = 0;
redraw = false;
+ emitting = false;
mesh = VisualServer::get_singleton()->mesh_create();
multimesh = VisualServer::get_singleton()->multimesh_create();
diff --git a/scene/3d/cpu_particles.cpp b/scene/3d/cpu_particles.cpp
index 5c895ecf22..8766e30d0b 100644
--- a/scene/3d/cpu_particles.cpp
+++ b/scene/3d/cpu_particles.cpp
@@ -240,8 +240,7 @@ void CPUParticles::restart() {
inactive_time = 0;
frame_remainder = 0;
cycle = 0;
-
- set_emitting(true);
+ emitting = false;
{
int pc = particles.size();
@@ -251,6 +250,8 @@ void CPUParticles::restart() {
w[i].active = false;
}
}
+
+ set_emitting(true);
}
void CPUParticles::set_direction(Vector3 p_direction) {
@@ -1494,6 +1495,7 @@ CPUParticles::CPUParticles() {
frame_remainder = 0;
cycle = 0;
redraw = false;
+ emitting = false;
set_notify_transform(true);