Skip to content

Instantly share code, notes, and snippets.

@zc00gii
Created September 25, 2010 20:14
Show Gist options
  • Save zc00gii/597262 to your computer and use it in GitHub Desktop.
Save zc00gii/597262 to your computer and use it in GitHub Desktop.
else if(t==PT_FUSE)
{
if(parts[i].life<=0) {
t = PT_NONE;
kill_part(i);
create_part(-1, x, y, PT_SMKE);
goto killed;
}
for(nx=-2; nx<3; nx++)
for(ny=-2; ny<3; ny++)
if(x+nx>=0 && y+ny>0 &&
x+nx<XRES && y+ny<YRES && (nx || ny))
{
r = pmap[y+ny][x+nx];
if((r>>8)>=NPART || !r)
continue;
if(((r&0xFF)==PT_FIRE || (r&0xFF)==PT_SPRK || (r&0xFF)==PT_PLSM) && 1>(rand()%500))
{
if(parts[i].life>40) {
parts[i].life = 39;
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment