summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSimon <simon@hardwired.org.uk>2010-12-07 21:16:04 (GMT)
committer Simon <simon@hardwired.org.uk>2010-12-07 21:16:04 (GMT)
commit2bd851e14835cc48e71f8c291e6ca2fdccfd7319 (patch)
tree6f0f7c52a3a2630454397d9287246591147347bd /src
parent76b6a886b3f99672d2894c4c12384b0feaa14852 (diff)
downloadpowder-2bd851e14835cc48e71f8c291e6ca2fdccfd7319.zip
powder-2bd851e14835cc48e71f8c291e6ca2fdccfd7319.tar.gz
Fixes for potential crashes
Diffstat (limited to 'src')
-rw-r--r--src/graphics.c4
-rw-r--r--src/main.c14
2 files changed, 10 insertions, 8 deletions
diff --git a/src/graphics.c b/src/graphics.c
index dc9d40a..65ffaac 100644
--- a/src/graphics.c
+++ b/src/graphics.c
@@ -2835,7 +2835,7 @@ pixel *prerender_save(void *save, int size, int *width, int *height)
j=d[p++];
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
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+1, y+6, x+3, y+12, 255, 255, 255, w);
}
- else
+ else*/
fb[y*w+x] = ptypes[j].pcolors;
}
}
diff --git a/src/main.c b/src/main.c
index e447f1d..f024aec 100644
--- a/src/main.c
+++ b/src/main.c
@@ -427,13 +427,15 @@ int parse_save(void *save, int size, int replace, int x0, int y0)
}
else
{
- if(c[3]==1||c[3]==0||c[3]==2||c[3]==3){
- legacy_enable = c[3]&0x01;
- if(ver>=44){
- sys_pause = (c[3]&0x02)>>1;
+ if(ver>=44){
+ legacy_enable = c[3]&0x01;
+ sys_pause = (c[3]>>1)&0x01;
+ } else {
+ if(c[3]==1||c[3]==0){
+ legacy_enable = c[3];
+ } else {
+ legacy_beta = 1;
}
- } else {
- legacy_beta = 1;
}
}