Fix 2 stickman bug

This commit is contained in:
Simon
2011-01-08 18:30:29 +00:00
parent cd08a7102c
commit ad7dc345d2

View File

@@ -689,11 +689,7 @@ inline int create_part(int p, int x, int y, int t)
parts[i].vx = 3.0f*cosf(a); parts[i].vx = 3.0f*cosf(a);
parts[i].vy = 3.0f*sinf(a); parts[i].vy = 3.0f*sinf(a);
} }
if(t==PT_BIZR||t==PT_BIZRG) if(t==PT_STKM)
parts[i].ctype = 0x47FFFF;
if(t!=PT_STKM&&t!=PT_STKM2 && t!=PT_PHOT)// && t!=PT_NEUT) is this needed? it breaks floodfill, Yes photons should not be placed in the PMAP
pmap[y][x] = t|(i<<8);
else if(t==PT_STKM)
{ {
if(isplayer==0) if(isplayer==0)
{ {
@@ -742,12 +738,16 @@ inline int create_part(int p, int x, int y, int t)
player[18] = y+12; player[18] = y+12;
isplayer = 1; isplayer = 1;
}
else
{
return -1;
} }
//kill_part(playerspawn); //kill_part(playerspawn);
create_part(-1,x,y,PT_SPAWN); create_part(-1,x,y,PT_SPAWN);
ISSPAWN1 = 1; ISSPAWN1 = 1;
} }
else if(t==PT_STKM2) if(t==PT_STKM2)
{ {
if(isplayer2==0) if(isplayer2==0)
{ {
@@ -796,11 +796,19 @@ inline int create_part(int p, int x, int y, int t)
player2[18] = y+12; player2[18] = y+12;
isplayer2 = 1; isplayer2 = 1;
}
else
{
return -1;
} }
//kill_part(player2spawn); //kill_part(player2spawn);
create_part(-1,x,y,PT_SPAWN2); create_part(-1,x,y,PT_SPAWN2);
ISSPAWN2 = 1; ISSPAWN2 = 1;
} }
if(t==PT_BIZR||t==PT_BIZRG)
parts[i].ctype = 0x47FFFF;
if(t!=PT_STKM&&t!=PT_STKM2 && t!=PT_PHOT)// && t!=PT_NEUT) is this needed? it breaks floodfill, Yes photons should not be placed in the PMAP
pmap[y][x] = t|(i<<8);
return i; return i;
} }
@@ -2581,9 +2589,6 @@ void update_particles_i(pixel *vid, int start, int inc)
if((r&0xFF)==PT_DYST && 15>(rand()%1000)) if((r&0xFF)==PT_DYST && 15>(rand()%1000))
parts[r>>8].type = PT_YEST; parts[r>>8].type = PT_YEST;
if((r&0xFF)==PT_YEST) { if((r&0xFF)==PT_YEST) {
if(15>(rand()%100000)&&isplayer==0)
parts[r>>8].type = PT_STKM;
else
parts[r>>8].type = PT_DYST; parts[r>>8].type = PT_DYST;
} }
@@ -4083,6 +4088,11 @@ killed:
if((parts[i].temp<309.6f) && (parts[i].temp>=243)) if((parts[i].temp<309.6f) && (parts[i].temp>=243))
parts[i].temp += 1; parts[i].temp += 1;
if (isplayer) { //Already a stickman in the simulation
death = 1;
parts[i].type = PT_NONE;
}
//Death //Death
if(parts[i].life<1 || death == 1 || (pv[y/CELL][x/CELL]>=4.5f && player[2] != SPC_AIR) ) //If his HP is less that 0 or there is very big wind... if(parts[i].life<1 || death == 1 || (pv[y/CELL][x/CELL]>=4.5f && player[2] != SPC_AIR) ) //If his HP is less that 0 or there is very big wind...
{ {
@@ -4473,6 +4483,11 @@ killed:
if((parts[i].temp<309.6f) && (parts[i].temp>=243)) if((parts[i].temp<309.6f) && (parts[i].temp>=243))
parts[i].temp += 1; parts[i].temp += 1;
if (isplayer2) { //Already a stickman2 in the simulation
death2 = 1;
parts[i].type = PT_NONE;
}
//Death //Death
if(parts[i].life<1 || death2 == 1 || (pv[y/CELL][x/CELL]>=4.5f && player2[2] != SPC_AIR) ) //If his HP is less that 0 or there is very big wind... if(parts[i].life<1 || death2 == 1 || (pv[y/CELL][x/CELL]>=4.5f && player2[2] != SPC_AIR) ) //If his HP is less that 0 or there is very big wind...
{ {
@@ -4484,7 +4499,7 @@ killed:
create_part(-1, x+2, y+r, player2[2]); create_part(-1, x+2, y+r, player2[2]);
} }
kill_part(i); //Kill him kill_part(i); //Kill him
goto killed; continue;
} }
parts[i].vy += -0.7*dt; //Head up! parts[i].vy += -0.7*dt; //Head up!