From 2bd851e14835cc48e71f8c291e6ca2fdccfd7319 Mon Sep 17 00:00:00 2001 From: Simon Date: Tue, 7 Dec 2010 21:16:04 +0000 Subject: [PATCH] Fixes for potential crashes --- src/graphics.c | 4 ++-- src/main.c | 14 ++++++++------ 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/graphics.c b/src/graphics.c index dc9d40a72..65ffaac45 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(j0) { - 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 e447f1d7b..f024aecc4 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; } }