diff options
author | Cyrille Henry <nusmuk@users.sourceforge.net> | 2013-02-16 18:41:00 +0000 |
---|---|---|
committer | Cyrille Henry <nusmuk@users.sourceforge.net> | 2013-02-16 18:41:00 +0000 |
commit | 08b61bd8350daef7499bae14ecb00d012b342ea4 (patch) | |
tree | 7f851744c50d147cd77b5b944af75d35a0294f88 /pmpd3d_various.c | |
parent | d6aeb7ce5870ac9a95e20a39660664a3f4e9d4be (diff) |
bugfix
svn path=/trunk/externals/pmpd/; revision=17037
Diffstat (limited to 'pmpd3d_various.c')
-rw-r--r-- | pmpd3d_various.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/pmpd3d_various.c b/pmpd3d_various.c index 5b1915c..912dd00 100644 --- a/pmpd3d_various.c +++ b/pmpd3d_various.c @@ -469,13 +469,13 @@ void pmpd3d_forcesXT(t_pmpd3d *x, t_symbol *s, int argc, t_atom *argv) { if ( argc == 1 ) // apply forces on all masses { - j = max(x->nb_mass, npoints); + j = min(x->nb_mass, npoints); for (i=0; i< j; i++) { x->mass[i].forceX += vec[i].w_float; } } - else if ( argv[1].a_type == A_SYMBOL ) + else if (( argc > 1 ) && ( argv[1].a_type == A_SYMBOL )) { i=0; j=0; @@ -515,13 +515,13 @@ void pmpd3d_forcesYT(t_pmpd3d *x, t_symbol *s, int argc, t_atom *argv) { if ( argc == 1 ) // apply forces on all masses { - j = max(x->nb_mass, npoints); + j = min(x->nb_mass, npoints); for (i=0; i< j; i++) { x->mass[i].forceY += vec[i].w_float; } } - else if ( argv[1].a_type == A_SYMBOL ) + else if (( argc > 1 ) && (argv[1].a_type == A_SYMBOL )) { i=0; j=0; @@ -561,13 +561,13 @@ void pmpd3d_forcesZT(t_pmpd3d *x, t_symbol *s, int argc, t_atom *argv) { if ( argc == 1 ) // apply forces on all masses { - j = max(x->nb_mass, npoints); + j = min(x->nb_mass, npoints); for (i=0; i< j; i++) { x->mass[i].forceZ += vec[i].w_float; } } - else if ( argv[1].a_type == A_SYMBOL ) + else if (( argc > 1 ) && ( argv[1].a_type == A_SYMBOL )) { i=0; j=0; |