From 673eb2437e2cc7491b94f95e0f65cd276e351872 Mon Sep 17 00:00:00 2001 From: Philip Date: Wed, 10 Nov 2010 18:02:40 -0500 Subject: [PATCH] fixed tiny bug where it wouldnt diffuse --- src/powder.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/powder.c b/src/powder.c index bb891c4f3..ca98e4338 100644 --- a/src/powder.c +++ b/src/powder.c @@ -1910,18 +1910,18 @@ void update_particles_i(pixel *vid, int start, int inc) parts[i].life --; } } - nx = rand()%5-2; - ny = rand()%5-2; - if(x+nx>=0 && y+ny>0 && - x+nx>8].type==t&&(parts[i].life>parts[r>>8].life)&&parts[i].life>0)//diffusion - { - parts[r>>8].life ++; - parts[i].life --; - } + nx = rand()%5-2; + ny = rand()%5-2; + if(x+nx>=0 && y+ny>0 && + x+nx>8].type==t&&(parts[i].life>parts[r>>8].life)&&parts[i].life>0&&!((r>>8)>=NPART || !r))//diffusion + { + parts[r>>8].life ++; + parts[i].life --; } + } } else if(t==PT_LCRY) {