Skip to content

Commit b93f6fa

Browse files
committed
Fix particles resetting properties when emitting is toggled
1 parent 88b9932 commit b93f6fa

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

scene/2d/cpu_particles_2d.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ void CPUParticles2D::set_emitting(bool p_emitting) {
4545
return;
4646
}
4747

48-
if (p_emitting && !use_fixed_seed) {
48+
if (p_emitting && !use_fixed_seed && one_shot) {
4949
set_seed(Math::rand());
5050
}
5151

scene/2d/gpu_particles_2d.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
void GPUParticles2D::set_emitting(bool p_emitting) {
4242
// Do not return even if `p_emitting == emitting` because `emitting` is just an approximation.
4343

44-
if (p_emitting && p_emitting != emitting && !use_fixed_seed) {
44+
if (p_emitting && p_emitting != emitting && !use_fixed_seed && one_shot) {
4545
set_seed(Math::rand());
4646
}
4747
if (p_emitting && one_shot) {

scene/3d/cpu_particles_3d.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ void CPUParticles3D::set_emitting(bool p_emitting) {
4848
return;
4949
}
5050

51-
if (p_emitting && !use_fixed_seed) {
51+
if (p_emitting && !use_fixed_seed && one_shot) {
5252
set_seed(Math::rand());
5353
}
5454

scene/3d/gpu_particles_3d.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ AABB GPUParticles3D::get_aabb() const {
4242

4343
void GPUParticles3D::set_emitting(bool p_emitting) {
4444
// Do not return even if `p_emitting == emitting` because `emitting` is just an approximation.
45-
if (p_emitting && p_emitting != emitting && !use_fixed_seed) {
45+
if (p_emitting && p_emitting != emitting && !use_fixed_seed && one_shot) {
4646
set_seed(Math::rand());
4747
}
4848
if (p_emitting && one_shot) {

0 commit comments

Comments
 (0)