Skip to content

Commit

Permalink
Merge pull request #79270 from clayjohn/particle-trails-error
Browse files Browse the repository at this point in the history
Unify error condition for particles trail lifetime
  • Loading branch information
akien-mga committed Jul 10, 2023
2 parents 74f1488 + 78ecdb1 commit 7030ac5
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion scene/2d/gpu_particles_2d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ void GPUParticles2D::set_trail_enabled(bool p_enabled) {
}

void GPUParticles2D::set_trail_lifetime(double p_seconds) {
ERR_FAIL_COND(p_seconds < 0.001);
ERR_FAIL_COND(p_seconds < 0.01);
trail_lifetime = p_seconds;
RS::get_singleton()->particles_set_trails(particles, trail_enabled, trail_lifetime);
queue_redraw();
Expand Down
2 changes: 1 addition & 1 deletion scene/3d/gpu_particles_3d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ void GPUParticles3D::set_trail_enabled(bool p_enabled) {
}

void GPUParticles3D::set_trail_lifetime(double p_seconds) {
ERR_FAIL_COND(p_seconds < 0.001);
ERR_FAIL_COND(p_seconds < 0.01);
trail_lifetime = p_seconds;
RS::get_singleton()->particles_set_trails(particles, trail_enabled, trail_lifetime);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@ void ParticlesStorage::particles_set_fractional_delta(RID p_particles, bool p_en
void ParticlesStorage::particles_set_trails(RID p_particles, bool p_enable, double p_length) {
Particles *particles = particles_owner.get_or_null(p_particles);
ERR_FAIL_COND(!particles);
ERR_FAIL_COND(p_length < 0.1);
ERR_FAIL_COND(p_length < 0.01);
p_length = MIN(10.0, p_length);

particles->trails_enabled = p_enable;
Expand Down

0 comments on commit 7030ac5

Please sign in to comment.