diff options
| author | Philip <philip@philip-linuxlaptop.(none)> | 2010-11-10 23:02:40 (GMT) |
|---|---|---|
| committer | Philip <philip@philip-linuxlaptop.(none)> | 2010-11-10 23:02:40 (GMT) |
| commit | 673eb2437e2cc7491b94f95e0f65cd276e351872 (patch) | |
| tree | 0083e3de327fa8fc9f90d197687c381a1f0f7470 /src | |
| parent | e47c60c07a942aad222f49ac895931807c77f7cc (diff) | |
| download | powder-673eb2437e2cc7491b94f95e0f65cd276e351872.zip powder-673eb2437e2cc7491b94f95e0f65cd276e351872.tar.gz | |
fixed tiny bug where it wouldnt diffuse
Diffstat (limited to 'src')
| -rw-r--r-- | src/powder.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/powder.c b/src/powder.c index bb891c4..ca98e43 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<XRES && y+ny<YRES && (nx || ny)) - { - r = pmap[y+ny][x+nx]; - if(parts[r>>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<XRES && y+ny<YRES && (nx || ny)) + { + r = pmap[y+ny][x+nx]; + if(parts[r>>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) { |
