From: dooglus Date: Wed, 24 Oct 2007 21:56:13 +0000 (+0000) Subject: Don't allow 'splits' to be less than 1, or we get a division by zero and an infinite... X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=6d12cf6d823b693ff8342752b00fdea813cff503;p=synfig.git Don't allow 'splits' to be less than 1, or we get a division by zero and an infinite loop. git-svn-id: http://svn.voria.com/code@964 1f10aa63-cdf2-0310-b900-c93c546f37ac --- diff --git a/synfig-core/trunk/src/modules/mod_particle/plant.cpp b/synfig-core/trunk/src/modules/mod_particle/plant.cpp index c97d3ae..7affc15 100644 --- a/synfig-core/trunk/src/modules/mod_particle/plant.cpp +++ b/synfig-core/trunk/src/modules/mod_particle/plant.cpp @@ -284,7 +284,11 @@ Plant::set_param(const String & param, const ValueBase &value) else if (step > 1) step=1; }); - IMPORT_PLUS(splits,needs_sync_=true); + IMPORT_PLUS(splits,{ + needs_sync_=true; + if (splits < 1) + splits = 1; + }); IMPORT_PLUS(sprouts,needs_sync_=true); IMPORT_PLUS(random_factor,needs_sync_=true); IMPORT_PLUS(drag,needs_sync_=true);