summaryrefslogtreecommitdiff
path: root/scene/2d/cpu_particles_2d.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'scene/2d/cpu_particles_2d.cpp')
-rw-r--r--scene/2d/cpu_particles_2d.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/scene/2d/cpu_particles_2d.cpp b/scene/2d/cpu_particles_2d.cpp
index 6cd33e32af..85c423964b 100644
--- a/scene/2d/cpu_particles_2d.cpp
+++ b/scene/2d/cpu_particles_2d.cpp
@@ -44,7 +44,7 @@ void CPUParticles2D::set_emitting(bool p_emitting) {
void CPUParticles2D::set_amount(int p_amount) {
- ERR_FAIL_COND(p_amount < 1);
+ ERR_FAIL_COND_MSG(p_amount < 1, "Amount of particles must be greater than 0.");
particles.resize(p_amount);
{
@@ -62,7 +62,7 @@ void CPUParticles2D::set_amount(int p_amount) {
}
void CPUParticles2D::set_lifetime(float p_lifetime) {
- ERR_FAIL_COND(p_lifetime <= 0);
+ ERR_FAIL_COND_MSG(p_lifetime <= 0, "Particles lifetime must be greater than 0.");
lifetime = p_lifetime;
}
@@ -1122,8 +1122,9 @@ void CPUParticles2D::_notification(int p_what) {
}
void CPUParticles2D::convert_from_particles(Node *p_particles) {
+
Particles2D *particles = Object::cast_to<Particles2D>(p_particles);
- ERR_FAIL_COND(!particles);
+ ERR_FAIL_COND_MSG(!particles, "Only Particles2D nodes can be converted to CPUParticles2D.");
set_emitting(particles->is_emitting());
set_amount(particles->get_amount());