]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - svvm_cmds.c
changed strzone, stuffcmd, and localcmd to be able to take multiple strings
[xonotic/darkplaces.git] / svvm_cmds.c
index 9b1492d1899d979dd420ce0eae8ac58dbd3a54c4..e096554524ed8389a361c93dea4a7fdcd6be73a9 100644 (file)
@@ -89,10 +89,12 @@ char *vm_sv_extensions =
 "DP_SV_NODRAWTOCLIENT "
 "DP_SV_PING "
 "DP_SV_PLAYERPHYSICS "
+"DP_SV_PRECACHEANYTIME "
 "DP_SV_PUNCHVECTOR "
 "DP_SV_ROTATINGBMODEL "
 "DP_SV_SETCOLOR "
 "DP_SV_SLOWMO "
+"DP_SV_WRITEUNTERMINATEDSTRING "
 "DP_TE_BLOOD "
 "DP_TE_BLOODSHOWER "
 "DP_TE_CUSTOMFLASH "
@@ -176,7 +178,7 @@ void SetMinMaxSize (prvm_edict_t *e, float *min, float *max, qboolean rotate)
 
        for (i=0 ; i<3 ; i++)
                if (min[i] > max[i])
-                       PRVM_ERROR("SetMinMaxSize: backwards mins/maxs\n");
+                       PRVM_ERROR("SetMinMaxSize: backwards mins/maxs");
 
 // set derived values
        VectorCopy (min, e->fields.server->mins);
@@ -550,7 +552,7 @@ void PF_checkpos (void)
 //============================================================================
 
 int checkpvsbytes;
-qbyte checkpvs[MAX_MAP_LEAFS/8];
+unsigned char checkpvs[MAX_MAP_LEAFS/8];
 
 int PF_newcheckclient (int check)
 {
@@ -651,14 +653,14 @@ PF_stuffcmd
 
 Sends text over to the client's execution buffer
 
-stuffcmd (clientent, value)
+stuffcmd (clientent, value, ...)
 =================
 */
 void PF_stuffcmd (void)
 {
        int             entnum;
-       const char      *str;
        client_t        *old;
+       char    string[VM_STRINGTEMP_LENGTH];
 
        entnum = PRVM_G_EDICTNUM(OFS_PARM0);
        if (entnum < 1 || entnum > svs.maxclients || !svs.clients[entnum-1].active)
@@ -666,11 +668,12 @@ void PF_stuffcmd (void)
                Con_Print("Can't stuffcmd to a non-client\n");
                return;
        }
-       str = PRVM_G_STRING(OFS_PARM1);
+
+       VM_VarString(1, string, sizeof(string));
 
        old = host_client;
        host_client = svs.clients + entnum-1;
-       Host_ClientCommands ("%s", str);
+       Host_ClientCommands ("%s", string);
        host_client = old;
 }
 
@@ -901,7 +904,7 @@ PF_pointcontents
 */
 void PF_pointcontents (void)
 {
-       PRVM_G_FLOAT(OFS_RETURN) = SV_PointQ1Contents(PRVM_G_VECTOR(OFS_PARM0));
+       PRVM_G_FLOAT(OFS_RETURN) = Mod_Q1BSP_NativeContentsFromSuperContents(NULL, SV_PointSuperContents(PRVM_G_VECTOR(OFS_PARM0)));
 }
 
 /*
@@ -1139,7 +1142,7 @@ sizebuf_t *WriteDest (void)
                        return &svs.clients[entnum-1].message;
 
        default:
-               Con_Printf ("WriteDest: bad destination");
+               Con_Printf ("WriteDest: bad destination\n");
        case MSG_ALL:
                return &sv.reliable_datagram;
 
@@ -1185,6 +1188,11 @@ void PF_WriteString (void)
        MSG_WriteString (WriteDest(), PRVM_G_STRING(OFS_PARM1));
 }
 
+void PF_WriteUnterminatedString (void)
+{
+       MSG_WriteUnterminatedString (WriteDest(), PRVM_G_STRING(OFS_PARM1));
+}
+
 
 void PF_WriteEntity (void)
 {
@@ -1789,6 +1797,22 @@ void PF_te_plasmaburn (void)
        MSG_WriteCoord(&sv.datagram, PRVM_G_VECTOR(OFS_PARM0)[2], sv.protocol);
 }
 
+void PF_te_flamejet (void)
+{
+       MSG_WriteByte(&sv.datagram, svc_temp_entity);
+       MSG_WriteByte(&sv.datagram, TE_FLAMEJET);
+       // org
+       MSG_WriteCoord(&sv.datagram, PRVM_G_VECTOR(OFS_PARM0)[0], sv.protocol);
+       MSG_WriteCoord(&sv.datagram, PRVM_G_VECTOR(OFS_PARM0)[1], sv.protocol);
+       MSG_WriteCoord(&sv.datagram, PRVM_G_VECTOR(OFS_PARM0)[2], sv.protocol);
+       // vel
+       MSG_WriteCoord(&sv.datagram, PRVM_G_VECTOR(OFS_PARM1)[0], sv.protocol);
+       MSG_WriteCoord(&sv.datagram, PRVM_G_VECTOR(OFS_PARM1)[1], sv.protocol);
+       MSG_WriteCoord(&sv.datagram, PRVM_G_VECTOR(OFS_PARM1)[2], sv.protocol);
+       // count
+       MSG_WriteByte(&sv.datagram, PRVM_G_FLOAT(OFS_PARM2));
+}
+
 static void clippointtosurface(msurface_t *surface, vec3_t p, vec3_t out)
 {
        int i, j, k;
@@ -2469,8 +2493,8 @@ PF_gettaginfo,                            // #452 vector(entity ent, float tagindex) gettaginfo (DP_QC_G
 PF_dropclient,                         // #453 void(entity clent) dropclient (DP_SV_DROPCLIENT)
 PF_spawnclient,                                // #454 entity() spawnclient (DP_SV_BOTCLIENT)
 PF_clienttype,                         // #455 float(entity clent) clienttype (DP_SV_BOTCLIENT)
-NULL,                                          // #456
-NULL,                                          // #457
+PF_WriteUnterminatedString,    // #456 void(float to, string s) WriteUnterminatedString (DP_SV_WRITEUNTERMINATEDSTRING)
+PF_te_flamejet,                                // #457 void(vector org, vector vel, float howmany) te_flamejet = #457 (DP_TE_FLAMEJET)
 NULL,                                          // #458
 NULL,                                          // #459
 e10, e10, e10, e10                     // #460-499 (LordHavoc)