]> de.git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
patch from esteel making the findkeysforcommand builtin available in
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Tue, 16 Sep 2008 13:36:21 +0000 (13:36 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Tue, 16 Sep 2008 13:36:21 +0000 (13:36 +0000)
csqc (formerly only available in menu qc)

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@8506 d7cf8633-e32d-0410-b094-e92efae38249

clvm_cmds.c
mvm_cmds.c
prvm_cmds.c
prvm_cmds.h

index f1d3b4ace8a33934c4ecddd289269e108f4ab254..289e531eed039e9391c2aed589f1c2581128603d 100644 (file)
@@ -3494,6 +3494,8 @@ NULL,                                                     // #516
 NULL,                                                  // #517
 NULL,                                                  // #518
 NULL,                                                  // #519
+VM_keynumtostring,                             // #520 string keynumtostring(float keynum)
+VM_findkeysforcommand,         // #521 string findkeysforcommand(string command)
 };
 
 const int vm_cl_numbuiltins = sizeof(vm_cl_builtins) / sizeof(prvm_builtin_t);
index 5b507dd33f7b7a81e8d8a6374b8dbaa87ed7e008..d4c447b1909543010b486876b3b524b2e27746dc 100644 (file)
@@ -229,40 +229,6 @@ void VM_M_getresolution(void)
        PRVM_G_VECTOR(OFS_RETURN)[2] = 0;
 }
 
-/*
-=========
-VM_M_findkeysforcommand
-
-string findkeysforcommand(string command)
-
-the returned string is an altstring
-=========
-*/
-#define NUMKEYS 5 // TODO: merge the constant in keys.c with this one somewhen
-
-void M_FindKeysForCommand(const char *command, int *keys);
-void VM_M_findkeysforcommand(void)
-{
-       const char *cmd;
-       char ret[VM_STRINGTEMP_LENGTH];
-       int keys[NUMKEYS];
-       int i;
-
-       VM_SAFEPARMCOUNT(1, VM_M_findkeysforcommand);
-
-       cmd = PRVM_G_STRING(OFS_PARM0);
-
-       VM_CheckEmptyString(cmd);
-
-       M_FindKeysForCommand(cmd, keys);
-
-       ret[0] = 0;
-       for(i = 0; i < NUMKEYS; i++)
-               strlcat(ret, va(" \'%i\'", keys[i]), sizeof(ret));
-
-       PRVM_G_INT(OFS_RETURN) = PRVM_SetTempString(ret);
-}
-
 /*
 =========
 VM_M_getserverliststat
@@ -1454,7 +1420,7 @@ VM_writetofile,                                   // #606 void writetofile(float fhandle, entity ent)
 VM_M_isfunction,                                       // #607 float isfunction(string function_name)
 VM_M_getresolution,                            // #608 vector getresolution(float number)
 VM_keynumtostring,                             // #609 string keynumtostring(float keynum)
-VM_M_findkeysforcommand,               // #610 string findkeysforcommand(string command)
+VM_findkeysforcommand,         // #610 string findkeysforcommand(string command)
 VM_M_getserverliststat,                        // #611 float gethostcachevalue(float type)
 VM_M_getserverliststring,              // #612 string gethostcachestring(float type, float hostnr)
 VM_parseentitydata,                            // #613 void parseentitydata(entity ent, string data)
index 2a4ebc8780a74bccf4fd4a733528b1200a0b8104..6d88a9d664d88d4571a58cfd88adfbab8169b45c 100644 (file)
@@ -3173,6 +3173,40 @@ void VM_keynumtostring (void)
        PRVM_G_INT(OFS_RETURN) = PRVM_SetTempString(Key_KeynumToString((int)PRVM_G_FLOAT(OFS_PARM0)));
 }
 
+/*
+=========
+VM_findkeysforcommand
+
+string findkeysforcommand(string command)
+
+the returned string is an altstring
+=========
+*/
+#define NUMKEYS 5 // TODO: merge the constant in keys.c with this one somewhen
+
+void M_FindKeysForCommand(const char *command, int *keys);
+void VM_findkeysforcommand(void)
+{
+       const char *cmd;
+       char ret[VM_STRINGTEMP_LENGTH];
+       int keys[NUMKEYS];
+       int i;
+
+       VM_SAFEPARMCOUNT(1, VM_findkeysforcommand);
+
+       cmd = PRVM_G_STRING(OFS_PARM0);
+
+       VM_CheckEmptyString(cmd);
+
+       M_FindKeysForCommand(cmd, keys);
+
+       ret[0] = 0;
+       for(i = 0; i < NUMKEYS; i++)
+               strlcat(ret, va(" \'%i\'", keys[i]), sizeof(ret));
+
+       PRVM_G_INT(OFS_RETURN) = PRVM_SetTempString(ret);
+}
+
 /*
 =========
 VM_stringtokeynum
index 54c8d7db63294a6e3b86b98f32f76c28b95c9340..42cd5d7c0c8a0991ca5389c0e2a8e9dbab002858 100644 (file)
@@ -359,6 +359,7 @@ void VM_makevectors (void);
 void VM_vectorvectors (void);
 
 void VM_keynumtostring (void);
+void VM_findkeysforcommand (void);
 void VM_stringtokeynum (void);
 
 void VM_cin_open( void );