459
460
461
462
463
464
465
466
467
468
469
470
471
472
|
long sz;
int i=3;
unsigned char*d=read_lump(FIL_SOLUTION,level_id,&sz);
if(sz<4 || !d || ((!argc || !sqlite3_value_int(*argv)) && (d[0]|(d[1]<<8))!=level_version)) {
free(d);
return;
}
if(d[2]&1) {
while(i<sz && d[i]) i++;
i++;
}
if(d[2]&2) i+=8;
if(i<sz) sqlite3_result_blob(cxt,d+i,sz-i,SQLITE_TRANSIENT);
free(d);
|
>
|
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
|
long sz;
int i=3;
unsigned char*d=read_lump(FIL_SOLUTION,level_id,&sz);
if(sz<4 || !d || ((!argc || !sqlite3_value_int(*argv)) && (d[0]|(d[1]<<8))!=level_version)) {
free(d);
return;
}
if(d[2]&128) i+=4;
if(d[2]&1) {
while(i<sz && d[i]) i++;
i++;
}
if(d[2]&2) i+=8;
if(i<sz) sqlite3_result_blob(cxt,d+i,sz-i,SQLITE_TRANSIENT);
free(d);
|