diff options
author | honix <ted888@ya.ru> | 2017-05-15 23:49:34 +0300 |
---|---|---|
committer | honix <ted888@ya.ru> | 2017-05-16 16:24:33 +0300 |
commit | 73385e362baf302fd044029072083e32b2e89d75 (patch) | |
tree | cbe6d685c4c6094665216cadbac8e2eb817a2d06 /scene | |
parent | 4db79346bb7aa0a8361e0d551005ffa64e5bc91c (diff) |
Particles potential crash fix 2
Diffstat (limited to 'scene')
-rw-r--r-- | scene/3d/particles.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/scene/3d/particles.cpp b/scene/3d/particles.cpp index 038ca33a41..71079ea780 100644 --- a/scene/3d/particles.cpp +++ b/scene/3d/particles.cpp @@ -48,11 +48,13 @@ void Particles::set_emitting(bool p_emitting) { void Particles::set_amount(int p_amount) { + ERR_FAIL_COND(p_amount < 1); amount = p_amount; VS::get_singleton()->particles_set_amount(particles, amount); } void Particles::set_lifetime(float p_lifetime) { + ERR_FAIL_COND(p_lifetime <= 0); lifetime = p_lifetime; VS::get_singleton()->particles_set_lifetime(particles, lifetime); } |