mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-01-17 22:50:51 +00:00
report all bad builtins rather than just the first
This commit is contained in:
parent
595280decb
commit
0ddb5eb822
1 changed files with 9 additions and 5 deletions
|
@ -112,6 +112,7 @@ int
|
|||
PR_RelocateBuiltins (progs_t *pr)
|
||||
{
|
||||
int i, ind;
|
||||
int bad = 0;
|
||||
dfunction_t *func;
|
||||
builtin_t *bi;
|
||||
const char *bi_name;
|
||||
|
@ -122,23 +123,26 @@ PR_RelocateBuiltins (progs_t *pr)
|
|||
if (func->first_statement > 0)
|
||||
continue;
|
||||
|
||||
bi_name = PR_GetString (pr, func->s_name);
|
||||
|
||||
if (!func->first_statement) {
|
||||
bi_name = PR_GetString (pr, func->s_name);
|
||||
bi = PR_FindBuiltin (pr, bi_name);
|
||||
if (!bi) {
|
||||
Sys_Printf ("PR_RelocateBuiltins: %s: undefined builtin %s\n",
|
||||
pr->progs_name, bi_name);
|
||||
return 0;
|
||||
bad = 1;
|
||||
continue;
|
||||
}
|
||||
func->first_statement = -bi->binum;
|
||||
}
|
||||
|
||||
ind = -func->first_statement;
|
||||
if (ind >= pr->numbuiltins || !(bi = pr->builtins[ind]) || !bi->proc) {
|
||||
Sys_Printf ("Bad builtin call number: %d\n", ind);
|
||||
return 0;
|
||||
Sys_Printf ("Bad builtin call number: %s = #%d\n", bi_name, ind);
|
||||
bad = 1;
|
||||
continue;
|
||||
}
|
||||
((bfunction_t *) func)->func = bi->proc;
|
||||
}
|
||||
return 1;
|
||||
return !bad;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue