added DP_ASINACOSATANATAN2TAN extension which adds common trig functions missing...
[xonotic/darkplaces.git] / mvm_cmds.c
index 657568e..4391965 100644 (file)
@@ -4,7 +4,8 @@
 // Menu
 
 char *vm_m_extensions =
-"DP_CINEMATIC_DPV";
+"DP_CINEMATIC_DPV "
+"DP_QC_ASINACOSATANATAN2TAN";
 
 /*
 =========
@@ -317,7 +318,7 @@ void VM_M_findkeysforcommand(void)
        M_FindKeysForCommand(cmd, keys);
 
        for(i = 0; i < NUMKEYS; i++)
-               ret = strcat(ret, va(" \'%i\'", keys[i]));
+               strlcat(ret, va(" \'%i\'", keys[i]), VM_STRINGTEMP_LENGTH);
 
        PRVM_G_INT(OFS_RETURN) = PRVM_SetEngineString(ret);
 }
@@ -427,19 +428,19 @@ void VM_M_setserverlistmaskstring( void )
 
        switch( field ) {
                case SLIF_CNAME:
-                       strncpy( mask->info.cname, PRVM_G_STRING( OFS_PARM2 ), sizeof(mask->info.cname) );
+                       strlcpy( mask->info.cname, PRVM_G_STRING( OFS_PARM2 ), sizeof(mask->info.cname) );
                        break;
                case SLIF_NAME:
-                       strncpy( mask->info.name, PRVM_G_STRING( OFS_PARM2 ), sizeof(mask->info.name)  );
+                       strlcpy( mask->info.name, PRVM_G_STRING( OFS_PARM2 ), sizeof(mask->info.name)  );
                        break;
                case SLIF_MAP:
-                       strncpy( mask->info.map, PRVM_G_STRING( OFS_PARM2 ), sizeof(mask->info.map)  );
+                       strlcpy( mask->info.map, PRVM_G_STRING( OFS_PARM2 ), sizeof(mask->info.map)  );
                        break;
                case SLIF_MOD:
-                       strncpy( mask->info.mod, PRVM_G_STRING( OFS_PARM2 ), sizeof(mask->info.mod)  );
+                       strlcpy( mask->info.mod, PRVM_G_STRING( OFS_PARM2 ), sizeof(mask->info.mod)  );
                        break;
                case SLIF_GAME:
-                       strncpy( mask->info.game, PRVM_G_STRING( OFS_PARM2 ), sizeof(mask->info.game)  );
+                       strlcpy( mask->info.game, PRVM_G_STRING( OFS_PARM2 ), sizeof(mask->info.game)  );
                        break;
                default:
                        VM_Warning( "VM_M_setserverlistmaskstring: Bad field number %i passed!\n", field );
@@ -862,7 +863,7 @@ prvm_builtin_t vm_m_builtins[] = {
        VM_search_getfilename, // 77
        VM_chr,
        VM_itof,
-       VM_ftoi,                // 80
+       VM_ftoe,                // 80
        VM_itof,                // isString
        VM_altstr_count,
        VM_altstr_prepare,
@@ -910,7 +911,12 @@ prvm_builtin_t vm_m_builtins[] = {
        VM_cin_restart, // 465
        VM_drawline,    // 466
        0,0,0,0,        // 470
-       e10,                    // 480
+       VM_asin,                                        // #471 float(float s) VM_asin (DP_QC_ASINACOSATANATAN2TAN)
+       VM_acos,                                        // #472 float(float c) VM_acos (DP_QC_ASINACOSATANATAN2TAN)
+       VM_atan,                                        // #473 float(float t) VM_atan (DP_QC_ASINACOSATANATAN2TAN)
+       VM_atan2,                                       // #474 float(float c, float s) VM_atan2 (DP_QC_ASINACOSATANATAN2TAN)
+       VM_tan,                                         // #475 float(float a) VM_tan (DP_QC_ASINACOSATANATAN2TAN)
+       0,0,0,0,0,                      // 480
        e10,                    // 490
        e10,                    // 500
        e100,                   // 600