mirror of
https://github.com/The-Powder-Toy/The-Powder-Toy.git
synced 2025-09-01 12:02:40 +02:00
Fix 2 stickman bug
This commit is contained in:
35
src/powder.c
35
src/powder.c
@@ -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].vy = 3.0f*sinf(a);
|
||||
}
|
||||
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);
|
||||
else if(t==PT_STKM)
|
||||
if(t==PT_STKM)
|
||||
{
|
||||
if(isplayer==0)
|
||||
{
|
||||
@@ -742,12 +738,16 @@ inline int create_part(int p, int x, int y, int t)
|
||||
player[18] = y+12;
|
||||
|
||||
isplayer = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
//kill_part(playerspawn);
|
||||
create_part(-1,x,y,PT_SPAWN);
|
||||
ISSPAWN1 = 1;
|
||||
}
|
||||
else if(t==PT_STKM2)
|
||||
if(t==PT_STKM2)
|
||||
{
|
||||
if(isplayer2==0)
|
||||
{
|
||||
@@ -796,11 +796,19 @@ inline int create_part(int p, int x, int y, int t)
|
||||
player2[18] = y+12;
|
||||
|
||||
isplayer2 = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
//kill_part(player2spawn);
|
||||
create_part(-1,x,y,PT_SPAWN2);
|
||||
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;
|
||||
}
|
||||
@@ -2581,9 +2589,6 @@ void update_particles_i(pixel *vid, int start, int inc)
|
||||
if((r&0xFF)==PT_DYST && 15>(rand()%1000))
|
||||
parts[r>>8].type = 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;
|
||||
}
|
||||
|
||||
@@ -4083,6 +4088,11 @@ killed:
|
||||
if((parts[i].temp<309.6f) && (parts[i].temp>=243))
|
||||
parts[i].temp += 1;
|
||||
|
||||
if (isplayer) { //Already a stickman in the simulation
|
||||
death = 1;
|
||||
parts[i].type = PT_NONE;
|
||||
}
|
||||
|
||||
//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...
|
||||
{
|
||||
@@ -4473,6 +4483,11 @@ killed:
|
||||
if((parts[i].temp<309.6f) && (parts[i].temp>=243))
|
||||
parts[i].temp += 1;
|
||||
|
||||
if (isplayer2) { //Already a stickman2 in the simulation
|
||||
death2 = 1;
|
||||
parts[i].type = PT_NONE;
|
||||
}
|
||||
|
||||
//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...
|
||||
{
|
||||
@@ -4484,7 +4499,7 @@ killed:
|
||||
create_part(-1, x+2, y+r, player2[2]);
|
||||
}
|
||||
kill_part(i); //Kill him
|
||||
goto killed;
|
||||
continue;
|
||||
}
|
||||
|
||||
parts[i].vy += -0.7*dt; //Head up!
|
||||
|
Reference in New Issue
Block a user