]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - mvm_cmds.c
patch from VorteX that makes GAME_DELUXEQUAKE mode reset a cvar in the
[xonotic/darkplaces.git] / mvm_cmds.c
index cef5830c09b207828a12b211d30cc10ca07763c8..e6dd8e215b942f4360b670b6785ecbcce6700b41 100644 (file)
@@ -1,4 +1,7 @@
+#include "quakedef.h"
+
 #include "prvm_cmds.h"
+#include "menu.h"
 
 //============================================================================
 // Menu
@@ -14,6 +17,7 @@ char *vm_m_extensions =
 "DP_QC_TOKENIZEBYSEPARATOR "
 "DP_QC_UNLIMITEDTEMPSTRINGS "
 "DP_QC_CMD "
+"DP_QC_STRREPLACE "
 ;
 
 /*
@@ -194,7 +198,6 @@ VM_M_getresolution
 vector getresolution(float number)
 =========
 */
-extern unsigned short video_resolutions[][2];
 void VM_M_getresolution(void)
 {
        int nr;
@@ -202,9 +205,9 @@ void VM_M_getresolution(void)
 
        nr = (int)PRVM_G_FLOAT(OFS_PARM0);
 
-
-       PRVM_G_VECTOR(OFS_RETURN)[0] = video_resolutions[nr][0];
-       PRVM_G_VECTOR(OFS_RETURN)[1] = video_resolutions[nr][1];
+       // FIXME bounds check
+       PRVM_G_VECTOR(OFS_RETURN)[0] = video_resolutions[nr].width;
+       PRVM_G_VECTOR(OFS_RETURN)[1] = video_resolutions[nr].height;
        PRVM_G_VECTOR(OFS_RETURN)[2] = 0;
 }
 
@@ -420,6 +423,9 @@ void VM_M_setserverlistmasknumber( void )
                case SLIF_PROTOCOL:
                        mask->info.protocol = number;
                        break;
+               case SLIF_FREESLOTS:
+                       mask->info.freeslots = number;
+                       break;
                default:
                        VM_Warning( "VM_M_setserverlistmasknumber: Bad field number %i passed!\n", field );
                        return;
@@ -532,6 +538,9 @@ void VM_M_getserverlistnumber(void)
                case SLIF_NUMHUMANS:
                        PRVM_G_FLOAT( OFS_RETURN ) = cache->info.numhumans;
                        break;
+               case SLIF_FREESLOTS:
+                       PRVM_G_FLOAT( OFS_RETURN ) = cache->info.freeslots;
+                       break;
                case SLIF_PING:
                        PRVM_G_FLOAT( OFS_RETURN ) = cache->info.ping;
                        break;
@@ -568,7 +577,7 @@ refreshserverlist()
 void VM_M_refreshserverlist( void )
 {
        VM_SAFEPARMCOUNT( 0, VM_M_refreshserverlist );
-       ServerList_QueryList(true, false);
+       ServerList_QueryList(false, true, false, false);
 }
 
 /*
@@ -606,6 +615,8 @@ void VM_M_getserverlistindexforkey( void )
                PRVM_G_FLOAT( OFS_RETURN ) = SLIF_NUMBOTS;
        else if( !strcmp( key, "numhumans" ) )
                PRVM_G_FLOAT( OFS_RETURN ) = SLIF_NUMHUMANS;
+       else if( !strcmp( key, "freeslots" ) )
+               PRVM_G_FLOAT( OFS_RETURN ) = SLIF_FREESLOTS;
        else if( !strcmp( key, "protocol" ) )
                PRVM_G_FLOAT( OFS_RETURN ) = SLIF_PROTOCOL;
        else
@@ -980,16 +991,16 @@ NULL,                                             // #217
 NULL,                                          // #218
 NULL,                                          // #219
 NULL,                                          // #220
-NULL,                                          // #221
+VM_strstrofs,                          // #221 float(string str, string sub[, float startpos]) strstrofs (FTE_STRINGS)
 NULL,                                          // #222
 NULL,                                          // #223
 NULL,                                          // #224
 NULL,                                          // #225
 NULL,                                          // #226
 NULL,                                          // #227
-NULL,                                          // #228
-NULL,                                          // #229
-NULL,                                          // #230
+VM_strncmp,                                    // #228 float(string s1, string s2, float len) strncmp (FTE_STRINGS)
+VM_strncasecmp,                                // #229 float(string s1, string s2) strcasecmp (FTE_STRINGS)
+VM_strncasecmp,                                // #230 float(string s1, string s2, float len) strncasecmp (FTE_STRINGS)
 NULL,                                          // #231
 NULL,                                          // #232
 NULL,                                          // #233
@@ -1227,8 +1238,8 @@ VM_cin_getstate,                  // #464
 VM_cin_restart,                        // #465
 VM_drawline,                           // #466
 VM_drawcolorcodedstring,       // #467
-NULL,                                          // #468
-NULL,                                          // #469
+VM_stringwidth,                                // #468
+VM_drawsubpic,                 // #469
 NULL,                                          // #470
 VM_asin,                                       // #471 float(float s) VM_asin (DP_QC_ASINACOSATANATAN2TAN)
 VM_acos,                                       // #472 float(float c) VM_acos (DP_QC_ASINACOSATANATAN2TAN)
@@ -1243,8 +1254,8 @@ VM_strtolower,                            // #480 string(string s) VM_strtolower : DRESK - Return string
 VM_strtoupper,                         // #481 string(string s) VM_strtoupper : DRESK - Return string as uppercase
 NULL,                                          // #482
 NULL,                                          // #483
-NULL,                                          // #484
-NULL,                                          // #485
+VM_strreplace,                         // #484 string(string search, string replace, string subject) strreplace (DP_QC_STRREPLACE)
+VM_strireplace,                                // #485 string(string search, string replace, string subject) strireplace (DP_QC_STRREPLACE)
 NULL,                                          // #486
 NULL,                                          // #487
 NULL,                                          // #488