When not actually executing, don't complain about invalid progs.dat versions for now.

This commit is contained in:
Wolfgang Bumiller 2013-01-17 17:36:06 +01:00
parent 8697fa59f3
commit 06f53b1a28
2 changed files with 4 additions and 4 deletions

6
exec.c
View file

@ -51,7 +51,7 @@ static void qcvmerror(qc_program *prog, const char *fmt, ...)
putchar('\n');
}
qc_program* prog_load(const char *filename)
qc_program* prog_load(const char *filename, bool skipversion)
{
qc_program *prog;
prog_header header;
@ -66,7 +66,7 @@ qc_program* prog_load(const char *filename)
return NULL;
}
if (header.version != 6) {
if (!skipversion && header.version != 6) {
loaderror("header says this is a version %i progs, we need version 6\n", header.version);
file_close(file);
return NULL;
@ -1080,7 +1080,7 @@ int main(int argc, char **argv)
exit(1);
}
prog = prog_load(progsfile);
prog = prog_load(progsfile, noexec);
if (!prog) {
printf("failed to load program '%s'\n", progsfile);
exit(1);

View file

@ -975,7 +975,7 @@ typedef struct qc_program_s {
int argc; /* current arg count for debugging */
} qc_program;
qc_program* prog_load(const char *filename);
qc_program* prog_load(const char *filename, bool ignoreversion);
void prog_delete(qc_program *prog);
bool prog_exec(qc_program *prog, prog_section_function *func, size_t flags, long maxjumps);