]> git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - prvm_exec.c
set svn:eol-style properties on new files
[xonotic/darkplaces.git] / prvm_exec.c
index 6deb4d95a0c2a24d8ffca5953a6cea0044e4382d..8fb0d69254722617045db75231ebb23c047bbf99 100644 (file)
@@ -523,7 +523,7 @@ void PRVM_Crash(void)
        if (prog == NULL)
                return;
 
-       prog->funcoffsets.SV_Shutdown = 0; // don't call SV_Shutdown on crash
+       PRVM_serverfunction(SV_Shutdown) = 0; // don't call SV_Shutdown on crash
 
        if( prog->depth > 0 )
        {
@@ -694,8 +694,8 @@ void MVM_ExecuteProgram (func_t fnum, const char *errormessage)
 
        if (!fnum || fnum >= (unsigned int)prog->numfunctions)
        {
-               if (prog->globaloffsets.self >= 0 && PRVM_GLOBALFIELDVALUE(prog->globaloffsets.self)->edict)
-                       PRVM_ED_Print(PRVM_PROG_TO_EDICT(PRVM_GLOBALFIELDVALUE(prog->globaloffsets.self)->edict), NULL);
+               if (PRVM_allglobaledict(self))
+                       PRVM_ED_Print(PRVM_PROG_TO_EDICT(PRVM_allglobaledict(self)), NULL);
                PRVM_ERROR ("MVM_ExecuteProgram: %s", errormessage);
        }
 
@@ -783,8 +783,8 @@ void CLVM_ExecuteProgram (func_t fnum, const char *errormessage)
 
        if (!fnum || fnum >= (unsigned int)prog->numfunctions)
        {
-               if (prog->globaloffsets.self >= 0 && PRVM_GLOBALFIELDVALUE(prog->globaloffsets.self)->edict)
-                       PRVM_ED_Print(PRVM_PROG_TO_EDICT(PRVM_GLOBALFIELDVALUE(prog->globaloffsets.self)->edict), NULL);
+               if (PRVM_allglobaledict(self))
+                       PRVM_ED_Print(PRVM_PROG_TO_EDICT(PRVM_allglobaledict(self)), NULL);
                PRVM_ERROR ("CLVM_ExecuteProgram: %s", errormessage);
        }
 
@@ -873,8 +873,8 @@ void SVVM_ExecuteProgram (func_t fnum, const char *errormessage)
 
        if (!fnum || fnum >= (unsigned int)prog->numfunctions)
        {
-               if (prog->globaloffsets.self >= 0 && PRVM_GLOBALFIELDVALUE(prog->globaloffsets.self)->edict)
-                       PRVM_ED_Print(PRVM_PROG_TO_EDICT(PRVM_GLOBALFIELDVALUE(prog->globaloffsets.self)->edict), NULL);
+               if (PRVM_allglobaledict(self))
+                       PRVM_ED_Print(PRVM_PROG_TO_EDICT(PRVM_allglobaledict(self)), NULL);
                PRVM_ERROR ("SVVM_ExecuteProgram: %s", errormessage);
        }