]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - prvm_cmds.c
fix typo
[xonotic/darkplaces.git] / prvm_cmds.c
index db63a14152180c928cb5984559710f52d5ba23f7..e555ad1703f7a74fba301fa72ec4e4167cab4b09 100644 (file)
@@ -116,14 +116,14 @@ void VM_error (void)
        char string[VM_STRINGTEMP_LENGTH];
 
        VM_VarString(0, string, sizeof(string));
-       Con_Printf("======%S ERROR in %s:\n%s\n", PRVM_NAME, PRVM_GetString(prog->xfunction->s_name), string);
+       Con_Printf("======%s ERROR in %s:\n%s\n", PRVM_NAME, PRVM_GetString(prog->xfunction->s_name), string);
        if(prog->self)
        {
                ed = PRVM_G_EDICT(prog->self->ofs);
                PRVM_ED_Print(ed);
        }
 
-       PRVM_ERROR ("%s: Program error", PRVM_NAME);
+       PRVM_ERROR ("%s: Program error in function %s:\n%s\n", PRVM_NAME, PRVM_GetString(prog->xfunction->s_name), string);
 }
 
 /*
@@ -142,7 +142,7 @@ void VM_objerror (void)
        char string[VM_STRINGTEMP_LENGTH];
 
        VM_VarString(0, string, sizeof(string));
-       Con_Printf("======%s OBJECT ERROR in %s:\n%s\n", PRVM_NAME, PRVM_GetString(prog->xfunction->s_name), string);
+       Con_Printf("======OBJECT ERROR======\n", PRVM_NAME, PRVM_GetString(prog->xfunction->s_name), string);
        if(prog->self)
        {
                ed = PRVM_G_EDICT (prog->self->ofs);
@@ -153,6 +153,7 @@ void VM_objerror (void)
        else
                // objerror has to display the object fields -> else call
                PRVM_ERROR ("VM_objecterror: self not defined !");
+       Con_Printf("%s OBJECT ERROR in %s:\n%s\n", PRVM_NAME, PRVM_GetString(prog->xfunction->s_name), string);
 }
 
 /*
@@ -219,9 +220,12 @@ void VM_sprint (void)
        }
 
        client = svs.clients + clientnum;
+       if (!client->netconnection)
+               return;
+
        VM_VarString(1, string, sizeof(string));
-       MSG_WriteChar(&client->message,svc_print);
-       MSG_WriteString(&client->message, string);
+       MSG_WriteChar(&client->netconnection->message,svc_print);
+       MSG_WriteString(&client->netconnection->message, string);
 }
 
 /*
@@ -2478,27 +2482,27 @@ float   drawpic(vector position, string pic, vector size, vector rgb, float alpha,
 */
 void VM_drawpic(void)
 {
-       const char *pic;
+       const char *picname;
        float *size, *pos, *rgb;
        int flag;
 
        VM_SAFEPARMCOUNT(6,VM_drawpic);
 
-       pic = PRVM_G_STRING(OFS_PARM1);
+       picname = PRVM_G_STRING(OFS_PARM1);
 
-       if(!pic)
+       if(!picname)
        {
                Con_Printf("VM_drawpic: %s passed null picture name !\n", PRVM_NAME);
                PRVM_G_FLOAT(OFS_RETURN) = -1;
                return;
        }
 
-       VM_CheckEmptyString (pic);
+       VM_CheckEmptyString (picname);
 
        // is pic cached ? no function yet for that
        if(!1)
        {
-               Con_Printf("VM_drawpic: %s: %s not cached !\n", PRVM_NAME, pic);
+               Con_Printf("VM_drawpic: %s: %s not cached !\n", PRVM_NAME, picname);
                PRVM_G_FLOAT(OFS_RETURN) = -4;
                return;
        }
@@ -2518,7 +2522,7 @@ void VM_drawpic(void)
        if(pos[2] || size[2])
                Con_Printf("VM_drawstring: z value%c from %s discarded\n",(pos[2] && size[2]) ? 's' : 0,((pos[2] && size[2]) ? "pos and size" : (pos[2] ? "pos" : "size")));
 
-       DrawQ_Pic(pos[0], pos[1], pic, size[0], size[1], rgb[0], rgb[1], rgb[2], PRVM_G_FLOAT(OFS_PARM4), flag);
+       DrawQ_Pic(pos[0], pos[1], Draw_CachePic(picname, false), size[0], size[1], rgb[0], rgb[1], rgb[2], PRVM_G_FLOAT(OFS_PARM4), flag);
        PRVM_G_FLOAT(OFS_RETURN) = 1;
 }
 
@@ -2552,7 +2556,7 @@ void VM_drawfill(void)
        if(pos[2] || size[2])
                Con_Printf("VM_drawstring: z value%c from %s discarded\n",(pos[2] && size[2]) ? 's' : 0,((pos[2] && size[2]) ? "pos and size" : (pos[2] ? "pos" : "size")));
 
-       DrawQ_Pic(pos[0], pos[1], 0, size[0], size[1], rgb[0], rgb[1], rgb[2], PRVM_G_FLOAT(OFS_PARM3), flag);
+       DrawQ_Pic(pos[0], pos[1], NULL, size[0], size[1], rgb[0], rgb[1], rgb[2], PRVM_G_FLOAT(OFS_PARM3), flag);
        PRVM_G_FLOAT(OFS_RETURN) = 1;
 }
 
@@ -2679,7 +2683,7 @@ void VM_cin_open( void )
        VM_CheckEmptyString( file );
     VM_CheckEmptyString( name );
 
-       if( CL_OpenVideo( file, name, MENUOWNER ) )
+       if( CL_OpenVideo( file, name, MENUOWNER, false ) )
                PRVM_G_FLOAT( OFS_RETURN ) = 1;
        else
                PRVM_G_FLOAT( OFS_RETURN ) = 0;