X-Git-Url: http://de.git.xonotic.org/?p=xonotic%2Fdarkplaces.git;a=blobdiff_plain;f=clvm_cmds.c;h=2d820b85f48a6a19c8b4daaf7f5d5767e7805fab;hp=f11af64d559bede5462c545c8bb2b2273567c6cd;hb=12241b4c7b82626b1e04a4b53c163626befc99c8;hpb=f489a657f28418efa08ca8907f5f78e17b44655f diff --git a/clvm_cmds.c b/clvm_cmds.c index f11af64d..2d820b85 100644 --- a/clvm_cmds.c +++ b/clvm_cmds.c @@ -351,8 +351,6 @@ int CSQC_EntitiesInBox (vec3_t mins, vec3_t maxs, int maxlist, prvm_edict_t **li { if (ent->priv.required->free) continue; -// VectorAdd(ent->fields.client->origin, ent->fields.client->mins, ent->fields.client->absmin); -// VectorAdd(ent->fields.client->origin, ent->fields.client->maxs, ent->fields.client->absmax); if(BoxesOverlap(mins, maxs, ent->fields.client->absmin, ent->fields.client->absmax)) list[k++] = ent; } @@ -644,8 +642,6 @@ static void VM_CL_R_AddEntities (void) ed = &prog->edicts[i]; if(ed->priv.required->free) continue; - VectorAdd(ed->fields.client->origin, ed->fields.client->mins, ed->fields.client->absmin); - VectorAdd(ed->fields.client->origin, ed->fields.client->maxs, ed->fields.client->absmax); CSQC_Think(ed); if(ed->priv.required->free) continue; @@ -758,25 +754,13 @@ static void VM_CL_R_SetView (void) PRVM_G_FLOAT(OFS_RETURN) = 1; } -extern void CL_UpdateNetworkEntity(entity_t *e, int recursionlimit); //#304 void() renderscene (EXT_CSQC) static void VM_CL_R_RenderScene (void) { - int i; VM_SAFEPARMCOUNT(0, VM_CL_R_RenderScene); // we need to update any RENDER_VIEWMODEL entities at this point because // csqc supplies its own view matrix - for (i = 1;i < cl.num_entities;i++) - { - if (cl.entities_active[i]) - { - entity_t *ent = cl.entities + i; - if ((ent->render.flags & RENDER_VIEWMODEL) || ent->state_current.tagentity) - CL_UpdateNetworkEntity(ent, 32); - } - } - // and of course the engine viewmodel needs updating as well - CL_UpdateNetworkEntity(&cl.viewent, 32); + CL_UpdateViewEntities(); // now draw stuff! R_RenderView(); } @@ -1347,16 +1331,29 @@ static void VM_CL_te_spark (void) CL_ParticleEffect(EFFECT_TE_SPARK, PRVM_G_FLOAT(OFS_PARM2), pos2, pos2, PRVM_G_VECTOR(OFS_PARM1), PRVM_G_VECTOR(OFS_PARM1), NULL, 0); } +extern cvar_t cl_sound_ric_gunshot; // #412 void(vector org) te_gunshotquad (DP_QUADEFFECTS1) static void VM_CL_te_gunshotquad (void) { float *pos; vec3_t pos2; + int rnd; VM_SAFEPARMCOUNT(1, VM_CL_te_gunshotquad); pos = PRVM_G_VECTOR(OFS_PARM0); CL_FindNonSolidLocation(pos, pos2, 4); CL_ParticleEffect(EFFECT_TE_GUNSHOTQUAD, 1, pos2, pos2, vec3_origin, vec3_origin, NULL, 0); + if(cl_sound_ric_gunshot.integer >= 2) + { + if (rand() % 5) S_StartSound(-1, 0, cl.sfx_tink1, pos2, 1, 1); + else + { + rnd = rand() & 3; + if (rnd == 1) S_StartSound(-1, 0, cl.sfx_ric1, pos2, 1, 1); + else if (rnd == 2) S_StartSound(-1, 0, cl.sfx_ric2, pos2, 1, 1); + else S_StartSound(-1, 0, cl.sfx_ric3, pos2, 1, 1); + } + } } // #413 void(vector org) te_spikequad (DP_QUADEFFECTS1) @@ -1445,11 +1442,23 @@ static void VM_CL_te_gunshot (void) { float *pos; vec3_t pos2; + int rnd; VM_SAFEPARMCOUNT(1, VM_CL_te_gunshot); pos = PRVM_G_VECTOR(OFS_PARM0); CL_FindNonSolidLocation(pos, pos2, 4); CL_ParticleEffect(EFFECT_TE_GUNSHOT, 1, pos2, pos2, vec3_origin, vec3_origin, NULL, 0); + if(cl_sound_ric_gunshot.integer == 1 || cl_sound_ric_gunshot.integer == 3) + { + if (rand() % 5) S_StartSound(-1, 0, cl.sfx_tink1, pos2, 1, 1); + else + { + rnd = rand() & 3; + if (rnd == 1) S_StartSound(-1, 0, cl.sfx_ric1, pos2, 1, 1); + else if (rnd == 2) S_StartSound(-1, 0, cl.sfx_ric2, pos2, 1, 1); + else S_StartSound(-1, 0, cl.sfx_ric3, pos2, 1, 1); + } + } } // #419 void(vector org) te_spike (DP_TE_STANDARDEFFECTBUILTINS) @@ -3152,9 +3161,9 @@ 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_QC_STRINGCOLORFUNCTIONS) VM_strftime, // #478 string(float uselocaltime, string format, ...) (DP_QC_STRFTIME) -NULL, // #479 -NULL, // #480 -NULL, // #481 +VM_tokenizebyseparator, // #479 float(string s) tokenizebyseparator (DP_QC_TOKENIZEBYSEPARATOR) +VM_strtolower, // #480 string(string s) VM_strtolower : DRESK - Return string as lowercase +VM_strtoupper, // #481 string(string s) VM_strtoupper : DRESK - Return string as uppercase NULL, // #482 NULL, // #483 NULL, // #484