mirror of
https://github.com/The-Powder-Toy/The-Powder-Toy.git
synced 2025-08-27 09:54:36 +02:00
fixed tiny bug where it wouldnt diffuse
This commit is contained in:
22
src/powder.c
22
src/powder.c
@@ -1910,18 +1910,18 @@ void update_particles_i(pixel *vid, int start, int inc)
|
|||||||
parts[i].life --;
|
parts[i].life --;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
nx = rand()%5-2;
|
nx = rand()%5-2;
|
||||||
ny = rand()%5-2;
|
ny = rand()%5-2;
|
||||||
if(x+nx>=0 && y+ny>0 &&
|
if(x+nx>=0 && y+ny>0 &&
|
||||||
x+nx<XRES && y+ny<YRES && (nx || ny))
|
x+nx<XRES && y+ny<YRES && (nx || ny))
|
||||||
{
|
{
|
||||||
r = pmap[y+ny][x+nx];
|
r = pmap[y+ny][x+nx];
|
||||||
if(parts[r>>8].type==t&&(parts[i].life>parts[r>>8].life)&&parts[i].life>0)//diffusion
|
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[r>>8].life ++;
|
||||||
parts[i].life --;
|
parts[i].life --;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if(t==PT_LCRY)
|
else if(t==PT_LCRY)
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user