]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - pr_exec.c
fix the inverted bumps on some surfaces (no longer uses CrossProduct to get the svector)
[xonotic/darkplaces.git] / pr_exec.c
index d9e81cde60a670479b83d8f41fb7c2696ffb0e0d..c2f1301934f58d0cfba99f2a4cb7f8d0524bfdf6 100644 (file)
--- a/pr_exec.c
+++ b/pr_exec.c
@@ -28,7 +28,9 @@ typedef struct
 } prstack_t;
 
 #define        MAX_STACK_DEPTH         256
-prstack_t      pr_stack[MAX_STACK_DEPTH];
+// stacktrace writes into pr_stack[MAX_STACK_DEPTH]
+// thus increase the array, so depth wont be overwritten
+prstack_t      pr_stack[MAX_STACK_DEPTH+1];
 int                    pr_depth = 0;
 
 #define        LOCALSTACK_SIZE         2048
@@ -241,19 +243,9 @@ void PR_Profile_f (void)
        } while (best);
 }
 
-
-void PR_Crash(void)
+void PR_PrintState(void)
 {
        int i;
-       if (pr_depth < 1)
-       {
-               // kill the stack just to be sure
-               pr_depth = 0;
-               localstack_used = 0;
-               return;
-       }
-
-       Con_Printf("QuakeC crash report:\n");
        if (pr_xfunction)
        {
                for (i = -4;i <= 0;i++)
@@ -263,6 +255,15 @@ void PR_Crash(void)
        else
                Con_Printf("null function executing??\n");
        PR_StackTrace ();
+}
+
+void PR_Crash(void)
+{
+       if (pr_depth > 0)
+       {
+               Con_Printf("QuakeC crash report:\n");
+               PR_PrintState();
+       }
 
        // dump the stack so host_error can shutdown functions
        pr_depth = 0;