mirror of
https://github.com/The-Powder-Toy/The-Powder-Toy.git
synced 2025-08-29 19:00:33 +02:00
Fixes for potential crashes
This commit is contained in:
@@ -2835,7 +2835,7 @@ pixel *prerender_save(void *save, int size, int *width, int *height)
|
|||||||
j=d[p++];
|
j=d[p++];
|
||||||
if(j<PT_NUM && j>0)
|
if(j<PT_NUM && j>0)
|
||||||
{
|
{
|
||||||
if(j==PT_STKM) //Stickman should be drawed another way
|
/*if(j==PT_STKM) //Stickman should be drawed another way //Was crashing TODO: FIX
|
||||||
{
|
{
|
||||||
//Stickman drawing
|
//Stickman drawing
|
||||||
for(k=-2; k<=1; k++)
|
for(k=-2; k<=1; k++)
|
||||||
@@ -2850,7 +2850,7 @@ pixel *prerender_save(void *save, int size, int *width, int *height)
|
|||||||
draw_line(fb , x, y+3, x+1, y+6, 255, 255, 255, w);
|
draw_line(fb , x, y+3, x+1, y+6, 255, 255, 255, w);
|
||||||
draw_line(fb , x+1, y+6, x+3, y+12, 255, 255, 255, w);
|
draw_line(fb , x+1, y+6, x+3, y+12, 255, 255, 255, w);
|
||||||
}
|
}
|
||||||
else
|
else*/
|
||||||
fb[y*w+x] = ptypes[j].pcolors;
|
fb[y*w+x] = ptypes[j].pcolors;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
14
src/main.c
14
src/main.c
@@ -427,13 +427,15 @@ int parse_save(void *save, int size, int replace, int x0, int y0)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if(c[3]==1||c[3]==0||c[3]==2||c[3]==3){
|
if(ver>=44){
|
||||||
legacy_enable = c[3]&0x01;
|
legacy_enable = c[3]&0x01;
|
||||||
if(ver>=44){
|
sys_pause = (c[3]>>1)&0x01;
|
||||||
sys_pause = (c[3]&0x02)>>1;
|
} else {
|
||||||
|
if(c[3]==1||c[3]==0){
|
||||||
|
legacy_enable = c[3];
|
||||||
|
} else {
|
||||||
|
legacy_beta = 1;
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
legacy_beta = 1;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user