]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
prvm_edict: Implement PRVM_ED_FindGlobalEval
authorcloudwalk <cloudwalk@d7cf8633-e32d-0410-b094-e92efae38249>
Fri, 24 Jul 2020 16:00:53 +0000 (16:00 +0000)
committercloudwalk <cloudwalk@d7cf8633-e32d-0410-b094-e92efae38249>
Fri, 24 Jul 2020 16:00:53 +0000 (16:00 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12873 d7cf8633-e32d-0410-b094-e92efae38249

progsvm.h
prvm_edict.c

index 06588fd4a2098c0095ba5c5e75ff0608d7f0c60b..82cb66c8f423f2bd80ffc003fd81c48bc5495b2b 100644 (file)
--- a/progsvm.h
+++ b/progsvm.h
@@ -815,6 +815,7 @@ void PRVM_GarbageCollection(prvm_prog_t *prog);
 
 ddef_t *PRVM_ED_FindField(prvm_prog_t *prog, const char *name);
 ddef_t *PRVM_ED_FindGlobal(prvm_prog_t *prog, const char *name);
+prvm_eval_t *PRVM_ED_FindGlobalEval(prvm_prog_t *prog, const char *name);
 mfunction_t *PRVM_ED_FindFunction(prvm_prog_t *prog, const char *name);
 
 int PRVM_ED_FindFieldOffset(prvm_prog_t *prog, const char *name);
index 61649a25f295ead13abe5b1d41343ca7c8394c54..3ca385a8fac6fec3bfda71ded0787d1630b2998f 100644 (file)
@@ -395,6 +395,16 @@ ddef_t *PRVM_ED_FindGlobal (prvm_prog_t *prog, const char *name)
        return NULL;
 }
 
+/*
+============
+PRVM_ED_FindGlobalEval
+============
+*/
+prvm_eval_t *PRVM_ED_FindGlobalEval(prvm_prog_t *prog, const char *name)
+{
+       ddef_t *def = PRVM_ED_FindGlobal(prog, name);
+       return def ? (prvm_eval_t *) &prog->globals.fp[def->ofs] : NULL;
+}
 
 /*
 ============