]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - prvm_exec.c
turned Mod_CheckLoaded into a #define
[xonotic/darkplaces.git] / prvm_exec.c
index ab166f35bbe3b733864e290501a01a0f4b3b64bf..5160fad8f9a3b13deaf9561c397163b49c36c6e9 100644 (file)
@@ -123,7 +123,14 @@ PRVM_PrintStatement
 */
 void PRVM_PrintStatement (dstatement_t *s)
 {
-       int             i;
+       size_t i;
+
+       if( prog->statement_linenums ) {
+               int opnum;
+
+               opnum = s - prog->statements;
+               Con_Printf( "%s:%i: ", PRVM_GetString( prog->xfunction->s_file ), prog->statement_linenums[ opnum ] );
+       }
 
        if ( (unsigned)s->op < sizeof(prvm_opnames)/sizeof(prvm_opnames[0]))
        {
@@ -199,7 +206,7 @@ void PRVM_Profile_f (void)
                Con_Print("prvm_profile <program name>\n");
                return;
        }
-       
+
        PRVM_Begin;
        if(!PRVM_SetProgFromString(Cmd_Argv(1)))
                return;
@@ -227,6 +234,7 @@ void PRVM_Profile_f (void)
                        num++;
                        best->profile = 0;
                        best->builtinsprofile = 0;
+                       best->callcount = 0;
                }
        } while (best);
 
@@ -245,7 +253,7 @@ void PRVM_CrashAll()
                PRVM_SetProg(i);
                PRVM_Crash();
        }
-       
+
        prog = oldprog;
 }
 
@@ -265,6 +273,9 @@ void PRVM_PrintState(void)
 
 void PRVM_Crash()
 {
+       if (prog == NULL)
+               return;
+
        if( prog->depth > 0 )
        {
                Con_Printf("QuakeC crash report for %s:\n", PRVM_NAME);
@@ -381,7 +392,7 @@ PRVM_ExecuteProgram
 extern cvar_t prvm_boundscheck;
 extern cvar_t prvm_traceqc;
 extern int             PRVM_ED_FindFieldOffset (const char *field);
-extern ddef_t* PRVM_ED_FindGlobal(const char *name); 
+extern ddef_t* PRVM_ED_FindGlobal(const char *name);
 void PRVM_ExecuteProgram (func_t fnum, const char *errormessage)
 {
        dstatement_t    *st;