]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - clvm_cmds.c
fix typo
[xonotic/darkplaces.git] / clvm_cmds.c
index f6b8ea3b640a07a13fe6f877ac0e39265f85f80d..7b3900a6c2b1023a3e653aa017e71f5fb4d70ebf 100644 (file)
@@ -441,7 +441,7 @@ void VM_CL_lightstyle (void)
 
        i = PRVM_G_FLOAT(OFS_PARM0);
        c = PRVM_G_STRING(OFS_PARM1);
-       if (i >= MAX_LIGHTSTYLES)
+       if (i >= cl_max_lightstyle)
                PF_WARNING("VM_CL_lightstyle >= MAX_LIGHTSTYLES\n");
        strlcpy (cl_lightstyle[i].map,  MSG_ReadString(), sizeof (cl_lightstyle[i].map));
        cl_lightstyle[i].map[MAX_STYLESTRING - 1] = 0;
@@ -800,8 +800,8 @@ static const int particleeffects_num = sizeof(particleeffect_names)/sizeof(char*
 static void CSQC_R_RecalcView (void)
 {
        extern matrix4x4_t viewmodelmatrix;
-       Matrix4x4_CreateIdentity(&viewmodelmatrix);
-       Matrix4x4_CreateIdentity(&r_refdef.viewentitymatrix);
+       viewmodelmatrix = identitymatrix;
+       r_refdef.viewentitymatrix = identitymatrix;
        Matrix4x4_CreateFromQuakeEntity(&r_refdef.viewentitymatrix, csqc_origin[0], csqc_origin[1], csqc_origin[2], csqc_angles[0], csqc_angles[1], csqc_angles[2], 1);
        Matrix4x4_CreateFromQuakeEntity(&viewmodelmatrix, csqc_origin[0], csqc_origin[1], csqc_origin[2], csqc_angles[0], csqc_angles[1], csqc_angles[2], 0.3);
 }
@@ -1222,15 +1222,15 @@ void VM_CL_pointparticles (void)
        case TE_SPIKEQUAD:
        case TE_GUNSHOT:
        case TE_GUNSHOTQUAD:
-               CL_SparkShower(f, v, 15, 1);
-               CL_Smoke(f, v, 15);
+               CL_SparkShower(f, v, 15, 1, 0);
+               CL_Smoke(f, v, 15, 0);
                if (cl_particles_bulletimpacts.integer)
                        CL_BulletMark(f);
                break;
        case TE_SUPERSPIKE:
        case TE_SUPERSPIKEQUAD:
-               CL_SparkShower(f, v, 30, 1);
-               CL_Smoke(f, v, 30);
+               CL_SparkShower(f, v, 30, 1, 0);
+               CL_Smoke(f, v, 30, 0);
                if (cl_particles_bulletimpacts.integer)
                        CL_BulletMark(f);
                break;
@@ -1263,7 +1263,7 @@ void VM_CL_pointparticles (void)
                CL_BloodPuff(f, v, n);
                break;
        case TE_SPARK:
-               CL_SparkShower(f, v, n, 1);
+               CL_SparkShower(f, v, n, 1, 0);
                break;
        case TE_FLAMEJET:
                CL_Flames(f, v, n);
@@ -1424,10 +1424,10 @@ void VM_CL_registercmd (void)
        {
                t = Z_Malloc(strlen(PRVM_G_STRING(OFS_PARM0))+1);
                strcpy(t, PRVM_G_STRING(OFS_PARM0));
-               Cmd_AddCommand(t, NULL);
+               Cmd_AddCommand(t, NULL, "console command created by QuakeC");
        }
        else
-               Cmd_AddCommand(PRVM_G_STRING(OFS_PARM0), NULL);
+               Cmd_AddCommand(PRVM_G_STRING(OFS_PARM0), NULL, "console command created by QuakeC");
 
 }
 
@@ -1477,13 +1477,13 @@ void VM_CL_ReadLong (void)
 //#364 float() readcoord (EXT_CSQC)
 void VM_CL_ReadCoord (void)
 {
-       PRVM_G_FLOAT(OFS_RETURN) = MSG_ReadCoord(cl.protocol);
+       PRVM_G_FLOAT(OFS_RETURN) = MSG_ReadCoord(cls.protocol);
 }
 
 //#365 float() readangle (EXT_CSQC)
 void VM_CL_ReadAngle (void)
 {
-       PRVM_G_FLOAT(OFS_RETURN) = MSG_ReadAngle(cl.protocol);
+       PRVM_G_FLOAT(OFS_RETURN) = MSG_ReadAngle(cls.protocol);
 }
 
 //#366 string() readstring (EXT_CSQC)
@@ -1589,7 +1589,7 @@ void VM_CL_te_spark (void)
                return;
        pos = PRVM_G_VECTOR(OFS_PARM0);
        CL_FindNonSolidLocation(pos, pos2, 4);
-       CL_SparkShower(pos2, PRVM_G_VECTOR(OFS_PARM1), PRVM_G_FLOAT(OFS_PARM2), 1);
+       CL_SparkShower(pos2, PRVM_G_VECTOR(OFS_PARM1), PRVM_G_FLOAT(OFS_PARM2), 1, 0);
 }
 
 // #412 void(vector org) te_gunshotquad (DP_QUADEFFECTS1)
@@ -1602,8 +1602,8 @@ void VM_CL_te_gunshotquad (void)
 
        pos = PRVM_G_VECTOR(OFS_PARM0);
        CL_FindNonSolidLocation(pos, pos2, 4);
-       CL_SparkShower(pos2, vec3_origin, 15, 1);
-       CL_Smoke(pos2, vec3_origin, 15);
+       CL_SparkShower(pos2, vec3_origin, 15, 1, 0);
+       CL_Smoke(pos2, vec3_origin, 15, 0);
        CL_BulletMark(pos2);
        Matrix4x4_CreateTranslate(&tempmatrix, pos2[0], pos2[1], pos2[2]);
        CL_AllocDlight(NULL, &tempmatrix, 100, 0.15f, 0.15f, 1.5f, 500, 0.2, 0, -1, true, 1, 0.25, 1, 0, 0, LIGHTFLAG_NORMALMODE | LIGHTFLAG_REALTIMEMODE);
@@ -1622,8 +1622,8 @@ void VM_CL_te_spikequad (void)
        CL_FindNonSolidLocation(pos, pos2, 4);
        if (cl_particles_bulletimpacts.integer)
        {
-               CL_SparkShower(pos2, vec3_origin, 15, 1);
-               CL_Smoke(pos2, vec3_origin, 15);
+               CL_SparkShower(pos2, vec3_origin, 15, 1, 0);
+               CL_Smoke(pos2, vec3_origin, 15, 0);
                CL_BulletMark(pos2);
        }
        Matrix4x4_CreateTranslate(&tempmatrix, pos2[0], pos2[1], pos2[2]);
@@ -1651,8 +1651,8 @@ void VM_CL_te_superspikequad (void)
        CL_FindNonSolidLocation(pos, pos2, 4);
        if (cl_particles_bulletimpacts.integer)
        {
-               CL_SparkShower(pos2, vec3_origin, 30, 1);
-               CL_Smoke(pos2, vec3_origin, 30);
+               CL_SparkShower(pos2, vec3_origin, 30, 1, 0);
+               CL_Smoke(pos2, vec3_origin, 30, 0);
                CL_BulletMark(pos2);
        }
        Matrix4x4_CreateTranslate(&tempmatrix, pos2[0], pos2[1], pos2[2]);
@@ -1680,8 +1680,7 @@ void VM_CL_te_explosionquad (void)
        CL_ParticleExplosion(pos2);
        Matrix4x4_CreateTranslate(&tempmatrix, pos2[0], pos2[1], pos2[2]);
        CL_AllocDlight(NULL, &tempmatrix, 350, 2.5f, 2.0f, 4.0f, 700, 0.5, 0, -1, true, 1, 0.25, 0.25, 1, 1, LIGHTFLAG_NORMALMODE | LIGHTFLAG_REALTIMEMODE);
-       if (gamemode != GAME_NEXUIZ)
-               S_StartSound(-1, 0, cl.sfx_r_exp3, pos2, 1, 1);
+       S_StartSound(-1, 0, cl.sfx_r_exp3, pos2, 1, 1);
 }
 
 // #416 void(vector org) te_smallflash (DP_TE_SMALLFLASH)
@@ -1721,8 +1720,8 @@ void VM_CL_te_gunshot (void)
 
        pos = PRVM_G_VECTOR(OFS_PARM0);
        CL_FindNonSolidLocation(pos, pos2, 4);
-       CL_SparkShower(pos2, vec3_origin, 15, 1);
-       CL_Smoke(pos2, vec3_origin, 15);
+       CL_SparkShower(pos2, vec3_origin, 15, 1, 0);
+       CL_Smoke(pos2, vec3_origin, 15, 0);
        CL_BulletMark(pos2);
 }
 
@@ -1738,8 +1737,8 @@ void VM_CL_te_spike (void)
        CL_FindNonSolidLocation(pos, pos2, 4);
        if (cl_particles_bulletimpacts.integer)
        {
-               CL_SparkShower(pos2, vec3_origin, 15, 1);
-               CL_Smoke(pos2, vec3_origin, 15);
+               CL_SparkShower(pos2, vec3_origin, 15, 1, 0);
+               CL_Smoke(pos2, vec3_origin, 15, 0);
                CL_BulletMark(pos2);
        }
        if (rand() % 5)                 S_StartSound(-1, 0, cl.sfx_tink1, pos2, 1, 1);
@@ -1764,8 +1763,8 @@ void VM_CL_te_superspike (void)
        CL_FindNonSolidLocation(pos, pos2, 4);
        if (cl_particles_bulletimpacts.integer)
        {
-               CL_SparkShower(pos2, vec3_origin, 30, 1);
-               CL_Smoke(pos2, vec3_origin, 30);
+               CL_SparkShower(pos2, vec3_origin, 30, 1, 0);
+               CL_Smoke(pos2, vec3_origin, 30, 0);
                CL_BulletMark(pos2);
        }
        if (rand() % 5)                 S_StartSound(-1, 0, cl.sfx_tink1, pos2, 1, 1);
@@ -1791,8 +1790,7 @@ void VM_CL_te_explosion (void)
        CL_ParticleExplosion(pos2);
        Matrix4x4_CreateTranslate(&tempmatrix, pos2[0], pos2[1], pos2[2]);
        CL_AllocDlight(NULL, &tempmatrix, 350, 4.0f, 2.0f, 0.50f, 700, 0.5, 0, -1, true, 1, 0.25, 0.25, 1, 1, LIGHTFLAG_NORMALMODE | LIGHTFLAG_REALTIMEMODE);
-       if (gamemode != GAME_NEXUIZ)
-               S_StartSound(-1, 0, cl.sfx_r_exp3, pos2, 1, 1);
+       S_StartSound(-1, 0, cl.sfx_r_exp3, pos2, 1, 1);
 }
 
 // #422 void(vector org) te_tarexplosion (DP_TE_STANDARDEFFECTBUILTINS)
@@ -1808,8 +1806,7 @@ void VM_CL_te_tarexplosion (void)
        CL_BlobExplosion(pos2);
        Matrix4x4_CreateTranslate(&tempmatrix, pos2[0], pos2[1], pos2[2]);
        CL_AllocDlight(NULL, &tempmatrix, 600, 1.6f, 0.8f, 2.0f, 1200, 0.5, 0, -1, true, 1, 0.25, 0.25, 1, 1, LIGHTFLAG_NORMALMODE | LIGHTFLAG_REALTIMEMODE);
-       if (gamemode != GAME_NEXUIZ)
-               S_StartSound(-1, 0, cl.sfx_r_exp3, pos2, 1, 1);
+       S_StartSound(-1, 0, cl.sfx_r_exp3, pos2, 1, 1);
 }
 
 // #423 void(vector org) te_wizspike (DP_TE_STANDARDEFFECTBUILTINS)
@@ -1885,8 +1882,7 @@ void VM_CL_te_explosion2 (void)
        color[2] = tempcolor[2] * (2.0f / 255.0f);
        Matrix4x4_CreateTranslate(&tempmatrix, pos2[0], pos2[1], pos2[2]);
        CL_AllocDlight(NULL, &tempmatrix, 350, color[0], color[1], color[2], 700, 0.5, 0, -1, true, 1, 0.25, 0.25, 1, 1, LIGHTFLAG_NORMALMODE | LIGHTFLAG_REALTIMEMODE);
-       if (gamemode != GAME_NEXUIZ)
-               S_StartSound(-1, 0, cl.sfx_r_exp3, pos2, 1, 1);
+       S_StartSound(-1, 0, cl.sfx_r_exp3, pos2, 1, 1);
 }
 
 
@@ -2252,7 +2248,7 @@ int CL_GetTagMatrix (matrix4x4_t *out, prvm_edict_t *ent, int tagindex)
        prvm_edict_t *attachent;
        model_t *model;
 
-       Matrix4x4_CreateIdentity(out); // warnings and errors return identical matrix
+       *out = identitymatrix; // warnings and errors return identical matrix
 
        if (ent == prog->edicts)
                return 1;
@@ -2289,7 +2285,7 @@ int CL_GetTagMatrix (matrix4x4_t *out, prvm_edict_t *ent, int tagindex)
                        return ret;
        }
        else
-               Matrix4x4_CreateIdentity(&tagmatrix);
+               tagmatrix = identitymatrix;
 
        if ((val = PRVM_GETEDICTFIELDVALUE(ent, csqc_fieldoff_tag_entity)) && val->edict)
        { // DP_GFX_QUAKE3MODELTAGS, scan all chain and stop on unattached entity
@@ -2314,7 +2310,7 @@ int CL_GetTagMatrix (matrix4x4_t *out, prvm_edict_t *ent, int tagindex)
                        if (model && val->_float >= 1 && model->animscenes && attachent->fields.client->frame >= 0 && attachent->fields.client->frame < model->numframes)
                                Mod_Alias_GetTagMatrix(model, model->animscenes[(int)attachent->fields.client->frame].firstframe, val->_float - 1, &attachmatrix);
                        else
-                               Matrix4x4_CreateIdentity(&attachmatrix);
+                               attachmatrix = identitymatrix;
 
                        // apply transformation by child entity matrix
                        val = PRVM_GETEDICTFIELDVALUE(ent, csqc_fieldoff_scale);