]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - svvm_cmds.c
added DP_QC_TOKENIZEBYSEPARATOR extension
[xonotic/darkplaces.git] / svvm_cmds.c
index b0283c952fe621e438562437cf7c474d6d463e65..bbe14a7734eb2ccea85d487feada55d67ccbfac5 100644 (file)
@@ -70,6 +70,7 @@ char *vm_sv_extensions =
 "DP_QC_STRFTIME "
 "DP_QC_STRINGBUFFERS "
 "DP_QC_STRINGCOLORFUNCTIONS "
+"DP_QC_TOKENIZEBYSEPARATOR "
 "DP_QC_TRACEBOX "
 "DP_QC_TRACETOSS "
 "DP_QC_TRACE_MOVETYPE_HITMODEL "
@@ -275,9 +276,17 @@ static void VM_SV_sprint (void)
        int                     entnum;
        char string[VM_STRINGTEMP_LENGTH];
 
+       VM_VarString(1, string, sizeof(string));
+
        VM_SAFEPARMCOUNTRANGE(2, 8, VM_SV_sprint);
 
        entnum = PRVM_G_EDICTNUM(OFS_PARM0);
+       // LordHavoc: div0 requested that sprintto world  operate like print
+       if (entnum == 0)
+       {
+               Con_Print(string);
+               return;
+       }
 
        if (entnum < 1 || entnum > svs.maxclients || !svs.clients[entnum-1].active)
        {
@@ -289,7 +298,6 @@ static void VM_SV_sprint (void)
        if (!client->netconnection)
                return;
 
-       VM_VarString(1, string, sizeof(string));
        MSG_WriteChar(&client->netconnection->message,svc_print);
        MSG_WriteString(&client->netconnection->message, string);
 }
@@ -3146,7 +3154,7 @@ VM_tan,                                                   // #475 float(float a) VM_tan (DP_QC_ASINACOSATANATAN2TAN)
 VM_strlennocol,                                        // #476 float(string s) : DRESK - String Length (not counting color codes) (DP_QC_STRINGCOLORFUNCTIONS)
 VM_strdecolorize,                              // #477 string(string s) : DRESK - Decolorized String (DP_SV_STRINGCOLORFUNCTIONS)
 VM_strftime,                                   // #478 string(float uselocaltime, string format, ...) (DP_QC_STRFTIME)
-NULL,                                                  // #479
+VM_tokenizebyseparator,                        // #479 float(string s) tokenizebyseparator (DP_QC_TOKENIZEBYSEPARATOR)
 NULL,                                                  // #480
 NULL,                                                  // #481
 NULL,                                                  // #482