]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - prvm_exec.c
support skin and pflags in light entity loader
[xonotic/darkplaces.git] / prvm_exec.c
index adaf7967eb16f057997a96d779a225966580a3aa..9816450c5dedb4281a664cb6fb3f9a66b8759595 100644 (file)
@@ -195,7 +195,7 @@ void PRVM_Profile_f (void)
        //      howmany = atoi(Cmd_Argv(1));
        if(Cmd_Argc() != 2)
        {
-               Con_Print("prvm_profile <program name>\n");
+               Con_Printf("prvm_profile <program name>\n");
                return;
        }
 
@@ -233,7 +233,8 @@ void PRVM_Profile_f (void)
 void PRVM_CrashAll()
 {
        int i;
-       PRVM_Begin; 
+       prvm_prog_t *oldprog = prog;
+
        for(i = 0; i < PRVM_MAXPROGS; i++)
        {
                if(!PRVM_ProgLoaded(i))
@@ -241,22 +242,13 @@ void PRVM_CrashAll()
                PRVM_SetProg(i);
                PRVM_Crash();
        }
-       PRVM_End;
+       
+       prog = oldprog;
 }
 
-void PRVM_Crash()
+void PRVM_PrintState(void)
 {
        int i;
-       
-       if (prog->depth < 1)
-       {
-               // kill the stack just to be sure
-               prog->depth = 0;
-               prog->localstack_used = 0;
-               return;
-       }
-
-       Con_Printf("QuakeC crash report for %s:\n", PRVM_NAME);
        if (prog->xfunction)
        {
                for (i = -4;i <= 0;i++)
@@ -266,6 +258,20 @@ void PRVM_Crash()
        else
                Con_Printf("null function executing??\n");
        PRVM_StackTrace ();
+}
+
+void PRVM_Crash()
+{
+       if (prog->depth < 1)
+       {
+               // kill the stack just to be sure
+               prog->depth = 0;
+               prog->localstack_used = 0;
+               return;
+       }
+
+       Con_Printf("QuakeC crash report for %s:\n", PRVM_NAME);
+       PRVM_PrintState();
 
        // dump the stack so host_error can shutdown functions
        prog->depth = 0;