summaryrefslogtreecommitdiff
path: root/src/main.c
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/main.c
parent76b6a886b3f99672d2894c4c12384b0feaa14852 (diff)
downloadpowder-2bd851e14835cc48e71f8c291e6ca2fdccfd7319.zip
powder-2bd851e14835cc48e71f8c291e6ca2fdccfd7319.tar.gz
Fixes for potential crashes
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c14
1 files changed, 8 insertions, 6 deletions
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;
}
}