diff --git a/engine/client/pr_csqc.c b/engine/client/pr_csqc.c index 615908ffe..4a13ea1b8 100644 --- a/engine/client/pr_csqc.c +++ b/engine/client/pr_csqc.c @@ -5025,7 +5025,10 @@ void CSQC_Event_Think(world_t *w, wedict_t *s) *csqcg.other = EDICT_TO_PROG(w->progs, (edict_t*)w->edicts); *csqcg.simtime = w->physicstime; - PR_ExecuteProgram (w->progs, s->v->think); + 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); } void CSQC_Event_Sound (float *origin, wedict_t *wentity, int channel, char *sample, int volume, float attenuation, int pitchadj) diff --git a/engine/qclib/pr_exec.c b/engine/qclib/pr_exec.c index a2a9eeedc..c5c9bfcef 100644 --- a/engine/qclib/pr_exec.c +++ b/engine/qclib/pr_exec.c @@ -1365,7 +1365,11 @@ void PDECL PR_ExecuteProgram (pubprogfuncs_t *ppf, func_t fnum) { // if (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"); +#endif // Host_Error ("PR_ExecuteProgram: NULL function from exe"); // PR_MoveParms(0, pr_typecurrent); diff --git a/engine/server/pr_cmds.c b/engine/server/pr_cmds.c index 01c4ca318..94707448e 100644 --- a/engine/server/pr_cmds.c +++ b/engine/server/pr_cmds.c @@ -533,7 +533,10 @@ void SVPR_Event_Think(world_t *w, wedict_t *s) { pr_global_struct->self = EDICT_TO_PROG(w->progs, s); pr_global_struct->other = EDICT_TO_PROG(w->progs, w->edicts); - PR_ExecuteProgram (w->progs, s->v->think); + 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); } qboolean SVPR_Event_ContentsTransition(world_t *w, wedict_t *ent, int oldwatertype, int newwatertype) diff --git a/engine/server/sv_user.c b/engine/server/sv_user.c index 52b30d401..6c6cbda28 100644 --- a/engine/server/sv_user.c +++ b/engine/server/sv_user.c @@ -1716,7 +1716,7 @@ void SV_Begin_Core(client_t *split) { eval_t *eval, *eval2; 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); int j;