try to be more verbose with null functions called from the engine.

git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4652 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
Spoike 2014-05-10 16:37:53 +00:00
parent 589b09ae1d
commit 6cc33d7d08
4 changed files with 13 additions and 3 deletions

View file

@ -5025,6 +5025,9 @@ void CSQC_Event_Think(world_t *w, wedict_t *s)
*csqcg.other = EDICT_TO_PROG(w->progs, (edict_t*)w->edicts); *csqcg.other = EDICT_TO_PROG(w->progs, (edict_t*)w->edicts);
*csqcg.simtime = w->physicstime; *csqcg.simtime = w->physicstime;
if (!s->v->think)
Con_Printf("CSQC entity \"%s\" has nextthink with no think function\n", PR_GetString(w->progs, s->v->classname));
else
PR_ExecuteProgram (w->progs, s->v->think); PR_ExecuteProgram (w->progs, s->v->think);
} }

View file

@ -1365,7 +1365,11 @@ void PDECL PR_ExecuteProgram (pubprogfuncs_t *ppf, func_t fnum)
{ {
// if (pr_global_struct->self) // if (pr_global_struct->self)
// ED_Print (PROG_TO_EDICT(pr_global_struct->self)); // ED_Print (PROG_TO_EDICT(pr_global_struct->self));
#ifdef __GNUC__
printf("PR_ExecuteProgram: NULL function from exe (address %p)\n", __builtin_return_address(0));
#else
printf("PR_ExecuteProgram: NULL function from exe\n"); printf("PR_ExecuteProgram: NULL function from exe\n");
#endif
// Host_Error ("PR_ExecuteProgram: NULL function from exe"); // Host_Error ("PR_ExecuteProgram: NULL function from exe");
// PR_MoveParms(0, pr_typecurrent); // PR_MoveParms(0, pr_typecurrent);

View file

@ -533,6 +533,9 @@ void SVPR_Event_Think(world_t *w, wedict_t *s)
{ {
pr_global_struct->self = EDICT_TO_PROG(w->progs, s); pr_global_struct->self = EDICT_TO_PROG(w->progs, s);
pr_global_struct->other = EDICT_TO_PROG(w->progs, w->edicts); pr_global_struct->other = EDICT_TO_PROG(w->progs, w->edicts);
if (!s->v->think)
Con_Printf("SSQC entity \"%s\" has nextthink with no think function\n", PR_GetString(w->progs, s->v->classname));
else
PR_ExecuteProgram (w->progs, s->v->think); PR_ExecuteProgram (w->progs, s->v->think);
} }

View file

@ -1716,7 +1716,7 @@ void SV_Begin_Core(client_t *split)
{ {
eval_t *eval, *eval2; eval_t *eval, *eval2;
eval = PR_FindGlobal(svprogfuncs, "ClientReEnter", 0, NULL); eval = PR_FindGlobal(svprogfuncs, "ClientReEnter", 0, NULL);
if (eval && split->spawninfo) if (eval && eval->function && split->spawninfo)
{ {
globalvars_t *pr_globals = PR_globals(svprogfuncs, PR_CURRENT); globalvars_t *pr_globals = PR_globals(svprogfuncs, PR_CURRENT);
int j; int j;