- for(i=0;i<particleeffects_num;i++)
- if(!strcasecmp(particleeffect_names[i], n))
- {
- PRVM_G_FLOAT(OFS_RETURN) = i;
- return;
- }
- PRVM_G_FLOAT(OFS_RETURN) = -1;
-}
-
-void CSQC_ParseBeam (int ent, vec3_t start, vec3_t end, model_t *m, int lightning)
-{
- int i;
- beam_t *b;
-
- // override any beam with the same entity
- for (i = 0, b = cl_beams;i < cl_max_beams;i++, b++)
- {
- if (b->entity == ent && ent)
- {
- //b->entity = ent;
- b->lightning = lightning;
- b->relativestartvalid = (ent && cl_csqcentities[ent].state_current.active) ? 2 : 0;
- b->model = m;
- b->endtime = cl.time + 0.2;
- VectorCopy (start, b->start);
- VectorCopy (end, b->end);
- return;
- }
- }
-
- // find a free beam
- for (i = 0, b = cl_beams;i < cl_max_beams;i++, b++)
- {
- if (!b->model || b->endtime < cl.time)
- {
- b->entity = ent;
- b->lightning = lightning;
- b->relativestartvalid = (ent && cl_csqcentities[ent].state_current.active) ? 2 : 0;
- b->model = m;
- b->endtime = cl.time + 0.2;
- VectorCopy (start, b->start);
- VectorCopy (end, b->end);
- return;
- }
- }
- Con_Print("beam list overflow!\n");