Fixed photons spawning, but it's still have some bugs.

This commit is contained in:
savask 2010-08-17 16:38:08 +08:00 committed by FacialTurd
parent 887895624c
commit ec1ab3fbcf

View File

@ -2442,8 +2442,23 @@ killed:
{ {
create_part(-1, nx, ny, player[2]); create_part(-1, nx, ny, player[2]);
r = pmap[ny][nx]; r = pmap[ny][nx];
if( ((r>>8) < NPART) && (r>>8)>=0 ) if( ((r>>8) < NPART) && (r>>8)>=0 && player[2]!=PT_PHOT)
parts[r>>8].vx = parts[r>>8].vx + 5*((((int)player[1])&0x02) == 0x02) - 5*(((int)(player[1])&0x01) == 0x01); parts[r>>8].vx = parts[r>>8].vx + 5*((((int)player[1])&0x02) == 0x02) - 5*(((int)(player[1])&0x01) == 0x01);
if(((r>>8) < NPART) && (r>>8)>=0 && player[2] == PT_PHOT)
{
int random = abs(rand()%3-1)*3;
if (random==0)
{
parts[r>>8].life = 0;
parts[r>>8].type = PT_NONE;
}
else
{
parts[r>>8].vy = 0;
parts[r>>8].vx = (((((int)player[1])&0x02) == 0x02) - (((int)(player[1])&0x01) == 0x01))*random;
}
}
} }
} }
} }