]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - prvm_cmds.c
Implement Con_Error(f) and Con_Warn(f), error and warning, for prettier colors
[xonotic/darkplaces.git] / prvm_cmds.c
index b3c6917551b83ab3a3c520e0b8724642941a3c71..73d0a89a6ad8c1d22a9056df437debe32c15827c 100644 (file)
@@ -32,7 +32,7 @@ void VM_Warning(prvm_prog_t *prog, const char *fmt, ...)
        dpvsnprintf(msg,sizeof(msg),fmt,argptr);
        va_end(argptr);
 
-       Con_Print(msg);
+       Con_Warn(msg);
 
        // TODO: either add a cvar/cmd to control the state dumping or replace some of the calls with Con_Printf [9/13/2006 Black]
        if(prvm_backtraceforwarnings.integer && recursive != realtime) // NOTE: this compares to the time, just in case if PRVM_PrintState causes a Host_Error and keeps recursive set
@@ -331,7 +331,7 @@ void VM_error(prvm_prog_t *prog)
        char string[VM_STRINGTEMP_LENGTH];
 
        VM_VarString(prog, 0, string, sizeof(string));
-       Con_Printf("======%s ERROR in %s:\n%s\n", prog->name, PRVM_GetString(prog, prog->xfunction->s_name), string);
+       Con_Errorf("======%s ERROR in %s:\n%s\n", prog->name, PRVM_GetString(prog, prog->xfunction->s_name), string);
        ed = PRVM_PROG_TO_EDICT(PRVM_allglobaledict(self));
        PRVM_ED_Print(prog, ed, NULL);
 
@@ -354,11 +354,11 @@ void VM_objerror(prvm_prog_t *prog)
        char string[VM_STRINGTEMP_LENGTH];
 
        VM_VarString(prog, 0, string, sizeof(string));
-       Con_Printf("======OBJECT ERROR======\n"); // , prog->name, PRVM_GetString(prog->xfunction->s_name), string); // or include them? FIXME
+       Con_Errorf("======OBJECT ERROR======\n"); // , prog->name, PRVM_GetString(prog->xfunction->s_name), string); // or include them? FIXME
        ed = PRVM_PROG_TO_EDICT(PRVM_allglobaledict(self));
        PRVM_ED_Print(prog, ed, NULL);
        PRVM_ED_Free (prog, ed);
-       Con_Printf("%s OBJECT ERROR in %s:\n%s\nTip: read above for entity information\n", prog->name, PRVM_GetString(prog, prog->xfunction->s_name), string);
+       Con_Errorf("%s OBJECT ERROR in %s:\n%s\nTip: read above for entity information\n", prog->name, PRVM_GetString(prog, prog->xfunction->s_name), string);
 }
 
 /*