From 586900f0c95d88426f3f31bce343692c2520299f Mon Sep 17 00:00:00 2001 From: Spoike Date: Sat, 6 Nov 2004 14:27:53 +0000 Subject: [PATCH] Fix for CheckSpawn, so that self is now always valid. (wasn't before) git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@397 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- engine/qclib/pr_edict.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/engine/qclib/pr_edict.c b/engine/qclib/pr_edict.c index f1aba2f38..b56261ad2 100644 --- a/engine/qclib/pr_edict.c +++ b/engine/qclib/pr_edict.c @@ -1875,6 +1875,8 @@ int LoadEnts(progfuncs_t *progfuncs, char *file, float killonspawnflags) } else { + eval_t *selfvar; + //added by request of Mercury. if (fulldata) //this is a vital part of HL map support!!! { //essentually, it passes the ent's spawn info to the ent. @@ -1889,12 +1891,12 @@ int LoadEnts(progfuncs_t *progfuncs, char *file, float killonspawnflags) fulldata->string = spawndata - progfuncs->stringtable; } + selfvar = (eval_t *)((int *)pr_globals + ED_FindGlobalOfs(progfuncs, "self")); + selfvar->edict = EDICT_TO_PROG(ed); + f = PR_FindFunc(progfuncs, var->string+progfuncs->stringtable, -2); if (f) { - eval_t *selfvar; - selfvar = (eval_t *)((int *)pr_globals + ED_FindGlobalOfs(progfuncs, "self")); - selfvar->edict = EDICT_TO_PROG(ed); if (CheckSpawn) { G_INT(OFS_PARM0) = f;