print builtin now prints all the passed strings, not just the first

This commit is contained in:
Wolfgang (Blub) Bumiller 2012-08-11 21:18:15 +02:00
parent 20831ddc6c
commit b36fabe4d7

8
exec.c
View file

@ -584,8 +584,11 @@ bool opts_memchk = false;
static int qc_print(qc_program *prog) static int qc_print(qc_program *prog)
{ {
qcany *str = (qcany*)(prog->globals + OFS_PARM0); size_t i;
printf("%s", prog_getstring(prog, str->string)); for (i = 0; i < prog->argc; ++i) {
qcany *str = (qcany*)(prog->globals + OFS_PARM0 + 3*i);
printf("%s", prog_getstring(prog, str->string));
}
return 0; return 0;
} }
@ -656,6 +659,7 @@ int main(int argc, char **argv)
if (!strcmp(name, "main")) if (!strcmp(name, "main"))
fnmain = (qcint)i; fnmain = (qcint)i;
} }
printf("Entity field space: %i\n", (int)prog->entityfields);
if (fnmain > 0) if (fnmain > 0)
{ {
prog_exec(prog, &prog->functions[fnmain], VMXF_TRACE, VM_JUMPS_DEFAULT); prog_exec(prog, &prog->functions[fnmain], VMXF_TRACE, VM_JUMPS_DEFAULT);