Move multiple STKM loading check
This commit is contained in:
parent
de820e36f8
commit
31b6e6a3cf
113
src/main.c
113
src/main.c
@ -714,7 +714,7 @@ int parse_save(void *save, int size, int replace, int x0, int y0, unsigned char
|
|||||||
j = PT_DUST;//goto corrupt;
|
j = PT_DUST;//goto corrupt;
|
||||||
}
|
}
|
||||||
gol[x][y]=0;
|
gol[x][y]=0;
|
||||||
if (j && !(player[27] == 1 && j==PT_STKM) && !(player2[27] == 1 && j==PT_STKM2)) //Don't comment this, it's needed
|
if (j)
|
||||||
{
|
{
|
||||||
if (pmap[y][x] && (pmap[y][x]>>8)<NPART)
|
if (pmap[y][x] && (pmap[y][x]>>8)<NPART)
|
||||||
{
|
{
|
||||||
@ -764,59 +764,6 @@ int parse_save(void *save, int size, int replace, int x0, int y0, unsigned char
|
|||||||
{
|
{
|
||||||
parts[i].vx = (d[p++]-127.0f)/16.0f;
|
parts[i].vx = (d[p++]-127.0f)/16.0f;
|
||||||
parts[i].vy = (d[p++]-127.0f)/16.0f;
|
parts[i].vy = (d[p++]-127.0f)/16.0f;
|
||||||
if (parts[i].type == PT_STKM)
|
|
||||||
{
|
|
||||||
//player[2] = PT_DUST;
|
|
||||||
|
|
||||||
player[3] = parts[i].x-1; //Setting legs positions
|
|
||||||
player[4] = parts[i].y+6;
|
|
||||||
player[5] = parts[i].x-1;
|
|
||||||
player[6] = parts[i].y+6;
|
|
||||||
|
|
||||||
player[7] = parts[i].x-3;
|
|
||||||
player[8] = parts[i].y+12;
|
|
||||||
player[9] = parts[i].x-3;
|
|
||||||
player[10] = parts[i].y+12;
|
|
||||||
|
|
||||||
player[11] = parts[i].x+1;
|
|
||||||
player[12] = parts[i].y+6;
|
|
||||||
player[13] = parts[i].x+1;
|
|
||||||
player[14] = parts[i].y+6;
|
|
||||||
|
|
||||||
player[15] = parts[i].x+3;
|
|
||||||
player[16] = parts[i].y+12;
|
|
||||||
player[17] = parts[i].x+3;
|
|
||||||
player[18] = parts[i].y+12;
|
|
||||||
|
|
||||||
player[27] = 1;
|
|
||||||
|
|
||||||
}
|
|
||||||
if (parts[i].type == PT_STKM2)
|
|
||||||
{
|
|
||||||
//player[2] = PT_DUST;
|
|
||||||
|
|
||||||
player2[3] = parts[i].x-1; //Setting legs positions
|
|
||||||
player2[4] = parts[i].y+6;
|
|
||||||
player2[5] = parts[i].x-1;
|
|
||||||
player2[6] = parts[i].y+6;
|
|
||||||
|
|
||||||
player2[7] = parts[i].x-3;
|
|
||||||
player2[8] = parts[i].y+12;
|
|
||||||
player2[9] = parts[i].x-3;
|
|
||||||
player2[10] = parts[i].y+12;
|
|
||||||
|
|
||||||
player2[11] = parts[i].x+1;
|
|
||||||
player2[12] = parts[i].y+6;
|
|
||||||
player2[13] = parts[i].x+1;
|
|
||||||
player2[14] = parts[i].y+6;
|
|
||||||
|
|
||||||
player2[15] = parts[i].x+3;
|
|
||||||
player2[16] = parts[i].y+12;
|
|
||||||
player2[17] = parts[i].x+3;
|
|
||||||
player2[18] = parts[i].y+12;
|
|
||||||
|
|
||||||
player2[27] = 1;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
p += 2;
|
p += 2;
|
||||||
@ -1026,6 +973,64 @@ int parse_save(void *save, int size, int replace, int x0, int y0, unsigned char
|
|||||||
// no more particle properties to load, so we can change type here without messing up loading
|
// no more particle properties to load, so we can change type here without messing up loading
|
||||||
if (i && i<=NPART)
|
if (i && i<=NPART)
|
||||||
{
|
{
|
||||||
|
if ((player[27] == 1 && ty==PT_STKM) || (player2[27] == 1 && ty==PT_STKM2))
|
||||||
|
{
|
||||||
|
parts[i-1].type = PT_NONE;
|
||||||
|
}
|
||||||
|
else if (parts[i-1].type == PT_STKM)
|
||||||
|
{
|
||||||
|
//player[2] = PT_DUST;
|
||||||
|
|
||||||
|
player[3] = parts[i-1].x-1; //Setti-1ng legs posi-1ti-1ons
|
||||||
|
player[4] = parts[i-1].y+6;
|
||||||
|
player[5] = parts[i-1].x-1;
|
||||||
|
player[6] = parts[i-1].y+6;
|
||||||
|
|
||||||
|
player[7] = parts[i-1].x-3;
|
||||||
|
player[8] = parts[i-1].y+12;
|
||||||
|
player[9] = parts[i-1].x-3;
|
||||||
|
player[10] = parts[i-1].y+12;
|
||||||
|
|
||||||
|
player[11] = parts[i-1].x+1;
|
||||||
|
player[12] = parts[i-1].y+6;
|
||||||
|
player[13] = parts[i-1].x+1;
|
||||||
|
player[14] = parts[i-1].y+6;
|
||||||
|
|
||||||
|
player[15] = parts[i-1].x+3;
|
||||||
|
player[16] = parts[i-1].y+12;
|
||||||
|
player[17] = parts[i-1].x+3;
|
||||||
|
player[18] = parts[i-1].y+12;
|
||||||
|
|
||||||
|
player[27] = 1;
|
||||||
|
|
||||||
|
}
|
||||||
|
else if (parts[i-1].type == PT_STKM2)
|
||||||
|
{
|
||||||
|
//player2[2] = PT_DUST;
|
||||||
|
|
||||||
|
player2[3] = parts[i-1].x-1; //Setti-1ng legs posi-1ti-1ons
|
||||||
|
player2[4] = parts[i-1].y+6;
|
||||||
|
player2[5] = parts[i-1].x-1;
|
||||||
|
player2[6] = parts[i-1].y+6;
|
||||||
|
|
||||||
|
player2[7] = parts[i-1].x-3;
|
||||||
|
player2[8] = parts[i-1].y+12;
|
||||||
|
player2[9] = parts[i-1].x-3;
|
||||||
|
player2[10] = parts[i-1].y+12;
|
||||||
|
|
||||||
|
player2[11] = parts[i-1].x+1;
|
||||||
|
player2[12] = parts[i-1].y+6;
|
||||||
|
player2[13] = parts[i-1].x+1;
|
||||||
|
player2[14] = parts[i-1].y+6;
|
||||||
|
|
||||||
|
player2[15] = parts[i-1].x+3;
|
||||||
|
player2[16] = parts[i-1].y+12;
|
||||||
|
player2[17] = parts[i-1].x+3;
|
||||||
|
player2[18] = parts[i-1].y+12;
|
||||||
|
|
||||||
|
player2[27] = 1;
|
||||||
|
}
|
||||||
|
|
||||||
if (ver<48 && (ty==OLD_PT_WIND || (ty==PT_BRAY&&parts[i-1].life==0)))
|
if (ver<48 && (ty==OLD_PT_WIND || (ty==PT_BRAY&&parts[i-1].life==0)))
|
||||||
{
|
{
|
||||||
// Replace invisible particles with something sensible and add decoration to hide it
|
// Replace invisible particles with something sensible and add decoration to hide it
|
||||||
|
Loading…
Reference in New Issue
Block a user